hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
844ee290c97366006e042d8ac5ba0899c883ac56 | 1,903 | py | Python | kge/core/component.py | Fredkiss3/kge | 389d5ab21ecb6dc1a25dd9f98245ba5938a5d253 | [
"CC0-1.0"
] | 4 | 2020-03-17T02:15:10.000Z | 2021-06-29T13:34:40.000Z | kge/core/component.py | Fredkiss3/kge | 389d5ab21ecb6dc1a25dd9f98245ba5938a5d253 | [
"CC0-1.0"
] | 4 | 2020-05-23T05:47:30.000Z | 2022-01-13T02:15:35.000Z | kge/core/component.py | Fredkiss3/kge | 389d5ab21ecb6dc1a25dd9f98245ba5938a5d253 | [
"CC0-1.0"
] | null | null | null | from typing import Callable
import kge
from kge.core import events
from kge.core.eventlib import EventMixin
from kge.core.events import Event
class BaseComponent(EventMixin):
"""
A component represents an element that can be added to an entity
to add a functionality
"""
def __fire_... | 33.982143 | 104 | 0.603783 | 1,717 | 0.90226 | 0 | 0 | 0 | 0 | 0 | 0 | 479 | 0.251708 |
844f9857dd2ca03aee9ac58b1348e52e4bc8e0ee | 766 | py | Python | src/870. Advantage Shuffle.py | rajshrivastava/LeetCode | dfe6342fe22b324429b0be3e5c0fef46c7e6b3b0 | [
"MIT"
] | 1 | 2019-12-16T08:18:25.000Z | 2019-12-16T08:18:25.000Z | src/870. Advantage Shuffle.py | rajshrivastava/LeetCode | dfe6342fe22b324429b0be3e5c0fef46c7e6b3b0 | [
"MIT"
] | null | null | null | src/870. Advantage Shuffle.py | rajshrivastava/LeetCode | dfe6342fe22b324429b0be3e5c0fef46c7e6b3b0 | [
"MIT"
] | null | null | null | class Solution:
def advantageCount(self, A: List[int], B: List[int]) -> List[int]:
n=len(A)
A.sort()
B_sorted_idxs = sorted(list(range(0,n)), key = lambda x: B[x])
permuted_A = [-1]*n
j = 0 #for A -index
remainingA = []
for idx in B_sorted_idxs:
w... | 27.357143 | 70 | 0.399478 | 765 | 0.998695 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 0.016971 |
84508cc0743106693c25a4c91852516182d10958 | 11,162 | py | Python | generate_population_dataset.py | p-enel/stable-and-dynamic-value | 3f78e24f5bef9b12b8cc43d075d2e66b8a603325 | [
"CC0-1.0"
] | 1 | 2020-07-29T09:18:00.000Z | 2020-07-29T09:18:00.000Z | generate_population_dataset.py | p-enel/stable-and-dynamic-value | 3f78e24f5bef9b12b8cc43d075d2e66b8a603325 | [
"CC0-1.0"
] | null | null | null | generate_population_dataset.py | p-enel/stable-and-dynamic-value | 3f78e24f5bef9b12b8cc43d075d2e66b8a603325 | [
"CC0-1.0"
] | 3 | 2020-07-27T03:12:19.000Z | 2021-11-02T20:03:00.000Z | from pathlib import Path
import numpy as np
import pickle as pk
from itertools import chain, product
from collections import OrderedDict
from structure import Struct
MONKEYS = ['M', 'N']
REGIONS = ['OFC', 'ACC']
TASKVARS = ['value', 'type']
SUBSPACES = [True, False]
EVT_WINS = OrderedDict((('cues ON', (-500, 1500)),
... | 43.601563 | 114 | 0.614854 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,472 | 0.400645 |
8450d07e5cec286e40f858637377c3e87f1ab9e5 | 634 | py | Python | setup.py | joepatmckenna/ohmlr | 2f3e63243758b995596f37897814634fc432f337 | [
"MIT"
] | null | null | null | setup.py | joepatmckenna/ohmlr | 2f3e63243758b995596f37897814634fc432f337 | [
"MIT"
] | null | null | null | setup.py | joepatmckenna/ohmlr | 2f3e63243758b995596f37897814634fc432f337 | [
"MIT"
] | null | null | null | import setuptools
with open('README.rst', 'r') as f:
readme = f.read()
with open('version', 'r') as f:
version = f.read()
if __name__ == '__main__':
setuptools.setup(
name='ohmlr',
version=version,
description='One-hot multinomial logisitc regression',
long_description=re... | 27.565217 | 65 | 0.615142 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 252 | 0.397476 |
8450ee0e08874b8a26468c905f5abfbc7260c448 | 1,301 | py | Python | commands/climber/holdcimbersposition.py | 1757WestwoodRobotics/2022-RapidReact | b6d9cf203fd35e93dc5d26ba2d6889e2a9edb137 | [
"MIT"
] | 1 | 2022-01-21T22:00:24.000Z | 2022-01-21T22:00:24.000Z | commands/climber/holdcimbersposition.py | 1757WestwoodRobotics/2022-RapidReact | b6d9cf203fd35e93dc5d26ba2d6889e2a9edb137 | [
"MIT"
] | 40 | 2022-01-18T21:20:54.000Z | 2022-03-31T20:56:44.000Z | commands/climber/holdcimbersposition.py | 1757WestwoodRobotics/2022-RapidReact | b6d9cf203fd35e93dc5d26ba2d6889e2a9edb137 | [
"MIT"
] | 1 | 2022-01-28T02:46:38.000Z | 2022-01-28T02:46:38.000Z | from commands2 import CommandBase, ParallelCommandGroup
from subsystems.climbers.leftclimbersubsystem import LeftClimber
from subsystems.climbers.rightclimbersubsystem import RightClimber
class HoldLeftClimberPosition(CommandBase):
def __init__(self, climber: LeftClimber) -> None:
CommandBase.__init__(sel... | 35.162162 | 77 | 0.730976 | 1,104 | 0.848578 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
84513ebf1e835ed2f032b1060dd720580d3e05a2 | 668 | py | Python | practicer_flask/app.py | DominikPott/practicer-flask | c8e523095bdd5912dadb7357d16a4e76229a04da | [
"MIT"
] | null | null | null | practicer_flask/app.py | DominikPott/practicer-flask | c8e523095bdd5912dadb7357d16a4e76229a04da | [
"MIT"
] | null | null | null | practicer_flask/app.py | DominikPott/practicer-flask | c8e523095bdd5912dadb7357d16a4e76229a04da | [
"MIT"
] | null | null | null | import os
from flask import Flask
import practicer_flask.auth
import practicer_flask.exercises
import practicer_flask.dashboard
import practicer_flask.topic
import practicer_flask.model_viewer
def create_app(test_config=None):
app = Flask(__name__)
app.config.from_mapping(SECRET_KEY=os.environ.get("SECRET_... | 23.857143 | 77 | 0.784431 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 0.050898 |
84533ec2f7f2ad9597755a4499563c795ed9f246 | 737 | py | Python | algo/visualizations/temporalchart.py | alexeyev/visartm | d19e193b3c084d7f355a45b966c8bb2ebb6fa366 | [
"BSD-3-Clause"
] | 1 | 2020-10-01T10:11:21.000Z | 2020-10-01T10:11:21.000Z | algo/visualizations/temporalchart.py | alexeyev/visartm | d19e193b3c084d7f355a45b966c8bb2ebb6fa366 | [
"BSD-3-Clause"
] | null | null | null | algo/visualizations/temporalchart.py | alexeyev/visartm | d19e193b3c084d7f355a45b966c8bb2ebb6fa366 | [
"BSD-3-Clause"
] | null | null | null | from models.models import Topic, TopicInTopic
import json
def visual(vis, params):
model = vis.model
group_by = params[1] # year,month,week,day
topics = Topic.objects.filter(
model=model,
layer=model.layers_count).order_by("spectrum_index")
topics = [topic.title for topic in topics]
... | 32.043478 | 76 | 0.639077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 70 | 0.09498 |
84580bc22605d3bb58c5f232f6e1f847342e88fa | 3,596 | py | Python | submissions-api/app/main/model/submissions_manifest.py | sanger-tol/tol-submissions | 8dbbfaa98b1dfa09a09cb54cf1b2eb9d1dca5331 | [
"MIT"
] | null | null | null | submissions-api/app/main/model/submissions_manifest.py | sanger-tol/tol-submissions | 8dbbfaa98b1dfa09a09cb54cf1b2eb9d1dca5331 | [
"MIT"
] | null | null | null | submissions-api/app/main/model/submissions_manifest.py | sanger-tol/tol-submissions | 8dbbfaa98b1dfa09a09cb54cf1b2eb9d1dca5331 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2021 Genome Research Ltd.
#
# SPDX-License-Identifier: MIT
from .base import Base, db
class SubmissionsManifest(Base):
__tablename__ = "manifest"
manifest_id = db.Column(db.Integer, primary_key=True)
samples = db.relationship('SubmissionsSample', back_populates="manifest",
... | 44.95 | 88 | 0.614294 | 3,480 | 0.967742 | 0 | 0 | 0 | 0 | 0 | 0 | 610 | 0.169633 |
8458ddef5330c4ed60d249ea5883464e063cf5ba | 6,411 | py | Python | eden/integration/hg/histedit_test.py | jmswen/eden | 5e0b051703fa946cc77fc43004435ae6b20599a1 | [
"BSD-3-Clause"
] | null | null | null | eden/integration/hg/histedit_test.py | jmswen/eden | 5e0b051703fa946cc77fc43004435ae6b20599a1 | [
"BSD-3-Clause"
] | null | null | null | eden/integration/hg/histedit_test.py | jmswen/eden | 5e0b051703fa946cc77fc43004435ae6b20599a1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
... | 36.220339 | 86 | 0.608641 | 5,912 | 0.922165 | 0 | 0 | 5,921 | 0.923569 | 0 | 0 | 2,038 | 0.317891 |
8459ea4275ad26f2fdfb1430948999a41ff39caf | 408 | py | Python | dailypy/__init__.py | HuangJiaLian/dailypy | b838a4f6743fca8ccc5c4fa73142d0f7095dbbc3 | [
"CC0-1.0"
] | null | null | null | dailypy/__init__.py | HuangJiaLian/dailypy | b838a4f6743fca8ccc5c4fa73142d0f7095dbbc3 | [
"CC0-1.0"
] | 1 | 2020-08-19T13:42:52.000Z | 2020-08-19T14:32:31.000Z | dailypy/__init__.py | HuangJiaLian/dailypy | b838a4f6743fca8ccc5c4fa73142d0f7095dbbc3 | [
"CC0-1.0"
] | null | null | null | import numpy as np
import os
# Data manipulate
class dm:
def __init__(self):
pass
def saveNp(self, a, name, path='.'):
np.save(os.path.join(path,name), a)
def saveTxt(self, a, name, path='.'):
np.savetxt(os.path.join(path,name)+'.txt', a)
def saveArrows(self, a1, a2, n... | 20.4 | 53 | 0.568627 | 355 | 0.870098 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 0.085784 |
845a911380b7475214d4489c0d02b5872a85aa00 | 310 | py | Python | Leetcode/0713. Subarray Product Less Than K/0713.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0713. Subarray Product Less Than K/0713.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | Leetcode/0713. Subarray Product Less Than K/0713.py | Next-Gen-UI/Code-Dynamics | a9b9d5e3f27e870b3e030c75a1060d88292de01c | [
"MIT"
] | null | null | null | class Solution:
def numSubarrayProductLessThanK(self, nums: List[int], k: int) -> int:
if k <= 1:
return 0
ans = 0
prod = 1
j = 0
for i, num in enumerate(nums):
prod *= num
while prod >= k:
prod /= nums[j]
j += 1
ans += i - j + 1
return ans
| 17.222222 | 72 | 0.490323 | 309 | 0.996774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
845c29a7df8a071ea4d00366b934a8a0a5899a8f | 2,832 | py | Python | vbb_backend/session/migrations/0002_auto_20210215_1509.py | patrickb42/backend-vbb-portal | 88362bc5b4d5cab95aa67e12694f98371604b65a | [
"MIT"
] | 3 | 2021-04-14T02:59:09.000Z | 2021-06-08T00:17:27.000Z | vbb_backend/session/migrations/0002_auto_20210215_1509.py | patrickb42/backend-vbb-portal | 88362bc5b4d5cab95aa67e12694f98371604b65a | [
"MIT"
] | 81 | 2020-12-08T00:11:52.000Z | 2021-08-09T18:13:32.000Z | vbb_backend/session/migrations/0002_auto_20210215_1509.py | patrickb42/backend-vbb-portal | 88362bc5b4d5cab95aa67e12694f98371604b65a | [
"MIT"
] | 5 | 2021-01-12T04:50:26.000Z | 2021-06-04T02:00:03.000Z | # Generated by Django 3.0.10 on 2021-02-15 15:09
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('users', '0006_auto_20210209_0849'),
('session', '0001_initial'),
]
operations = [
migr... | 37.76 | 153 | 0.598517 | 2,693 | 0.950918 | 0 | 0 | 0 | 0 | 0 | 0 | 667 | 0.235523 |
845d03992ff2924ffdc957b51de3c6b486a7c0ea | 880 | py | Python | src/las_util/serializers.py | dcslagel/las-util-django | cea8437813969b3b22182de6b9553b9e6694c548 | [
"BSD-3-Clause"
] | 3 | 2020-05-15T05:40:43.000Z | 2021-11-09T06:19:41.000Z | src/las_util/serializers.py | dcslagel/las-util-django | cea8437813969b3b22182de6b9553b9e6694c548 | [
"BSD-3-Clause"
] | 26 | 2020-05-20T13:03:02.000Z | 2021-09-23T19:36:39.000Z | src/las_util/serializers.py | dcslagel/las-util-django | cea8437813969b3b22182de6b9553b9e6694c548 | [
"BSD-3-Clause"
] | 1 | 2021-11-09T01:40:05.000Z | 2021-11-09T01:40:05.000Z | """
File-Name: [app]/serializers.py
File-Desc: Rest API serializers for las_util
App-Name: las_util
Project-Name: Las-Util-Django
Copyright: Copyright (c) 2019, DC Slagel
License-Identifier: BSD-3-Clause
"""
from rest_framework import serializers
from las_util.models import SectionInfo
class DocSerializer(serializers.... | 29.333333 | 55 | 0.7125 | 356 | 0.404545 | 0 | 0 | 0 | 0 | 0 | 0 | 554 | 0.629545 |
845d9d3e1de64db798d6f4d7e46d76bf4c2959c6 | 3,965 | py | Python | UI/python/runtext.py | maxxscholten/nyc-train-sign | 7da32c413270f3bf4629969bcf16f7def4ddb372 | [
"MIT"
] | 8 | 2020-02-19T21:17:04.000Z | 2022-01-04T03:52:56.000Z | UI/python/runtext.py | maxxscholten/nyc-train-sign | 7da32c413270f3bf4629969bcf16f7def4ddb372 | [
"MIT"
] | 1 | 2021-09-20T02:13:41.000Z | 2021-09-21T07:01:14.000Z | UI/python/runtext.py | maxxscholten/nyc-train-sign | 7da32c413270f3bf4629969bcf16f7def4ddb372 | [
"MIT"
] | 4 | 2021-03-11T17:11:40.000Z | 2021-11-10T01:20:33.000Z | #!/usr/bin/env python
# Display a runtext with double-buffering.
from samplebase import SampleBase
from rgbmatrix import graphics
import time
import requests
import transitfeed
import datetime
import arrow
import schedule
today = datetime.date.today()
starttime = time.time()
schedule = transitfeed.Schedule()
url = "ht... | 37.056075 | 121 | 0.640858 | 3,293 | 0.830517 | 0 | 0 | 0 | 0 | 0 | 0 | 372 | 0.093821 |
8460d12d7847a84d2047777b7d49fa013dbd6421 | 92 | py | Python | back/apps/base_user/apps.py | pylvin/nuxt-drf-template | e3f32cf98a2bdf393f88fbda2afedf2c0bf99dc7 | [
"MIT"
] | 2 | 2021-11-16T03:47:06.000Z | 2021-12-21T20:19:30.000Z | back/apps/base_user/apps.py | pylvin/nuxt-drf-template | e3f32cf98a2bdf393f88fbda2afedf2c0bf99dc7 | [
"MIT"
] | null | null | null | back/apps/base_user/apps.py | pylvin/nuxt-drf-template | e3f32cf98a2bdf393f88fbda2afedf2c0bf99dc7 | [
"MIT"
] | 2 | 2021-12-21T20:19:39.000Z | 2022-01-03T11:27:04.000Z | from django.apps import AppConfig
class BaseUserConfig(AppConfig):
name = 'base_user'
| 15.333333 | 33 | 0.76087 | 55 | 0.597826 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 0.119565 |
8462591fa4b3c8c3275d239bf45765f52bee1b94 | 1,188 | py | Python | model/board_generator.py | myrmarachne/minesweeper | 777170b7a31f1feed0bdf7aca31aaa9916c9b915 | [
"AFL-1.1"
] | null | null | null | model/board_generator.py | myrmarachne/minesweeper | 777170b7a31f1feed0bdf7aca31aaa9916c9b915 | [
"AFL-1.1"
] | null | null | null | model/board_generator.py | myrmarachne/minesweeper | 777170b7a31f1feed0bdf7aca31aaa9916c9b915 | [
"AFL-1.1"
] | null | null | null | from random import sample
from tile import Tile
from utils import neighbours
class BoardGenerator:
def __init__(self, size, numMines):
self.numMines = numMines
self.size = size
self.board = []
self.generate_board()
def generate_board(self):
# Generate a board for Mines... | 38.322581 | 115 | 0.616162 | 1,108 | 0.93266 | 0 | 0 | 0 | 0 | 0 | 0 | 284 | 0.239057 |
8463673ccc7d5d8251d46b1bed4eb08caa70dd68 | 1,054 | py | Python | src/the_tale/the_tale/game/pvp/objects.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/game/pvp/objects.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/game/pvp/objects.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z |
import smart_imports
smart_imports.all()
class BattleRequest:
__slots__ = ('id', 'initiator_id', 'matchmaker_type', 'created_at', 'updated_at')
def __init__(self, id, initiator_id, matchmaker_type, created_at, updated_at):
self.id = id
self.initiator_id = initiator_id
self.matchmake... | 31.939394 | 85 | 0.66129 | 1,005 | 0.95351 | 0 | 0 | 0 | 0 | 0 | 0 | 169 | 0.160342 |
8463c9fd49aa8b29fdde20c5d6a8fdfd2fb75f46 | 300 | py | Python | src/gencoef/test.py | bwasti/sleef | 4d260ae7f5d0e76a3c5424149deb838373e1894b | [
"BSL-1.0"
] | null | null | null | src/gencoef/test.py | bwasti/sleef | 4d260ae7f5d0e76a3c5424149deb838373e1894b | [
"BSL-1.0"
] | null | null | null | src/gencoef/test.py | bwasti/sleef | 4d260ae7f5d0e76a3c5424149deb838373e1894b | [
"BSL-1.0"
] | null | null | null | import numpy as np
import math
p = np.poly1d([
+0.1429511242e-53,
+0.1561712123e-44,
-0.2259472298e-35,
-0.2669710222e-26,
+0.9784247973e-18,
+0.1655572013e-8,
+0.3991098106e+0,
])
def sigmoid(x):
return 1 / (1 + math.exp(-x))
for i in range(1000):
k = float(i) / 100
print(sigmoid(k), p(k))
| 15.789474 | 31 | 0.656667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
846536aeea05536d64f4f59f9d2196f85d857b4d | 19,035 | py | Python | forever/Database.py | dss285/4ever | bd6f70f92d76d43342da401562f2c504adaf3867 | [
"MIT"
] | null | null | null | forever/Database.py | dss285/4ever | bd6f70f92d76d43342da401562f2c504adaf3867 | [
"MIT"
] | null | null | null | forever/Database.py | dss285/4ever | bd6f70f92d76d43342da401562f2c504adaf3867 | [
"MIT"
] | null | null | null | import psycopg2
import psycopg2.extras
import discord
from models.BotMention import BotMention
from models.UpdatedMessage import UpdatedMessage
from forever.Steam import Steam_API, Dota_Match, Dota_Match_Player
from forever.Utilities import run_in_executor, log
from forever.Warframe import CetusMessage, FissureM... | 38.222892 | 180 | 0.640294 | 18,473 | 0.970475 | 0 | 0 | 170 | 0.008931 | 8,186 | 0.43005 | 5,632 | 0.295876 |
8465f309612202475ac3cb61d22a9dcf1509182e | 822 | py | Python | Week06/q_cifar10_cnn.py | HowardNTUST/HackNTU_Data_2017 | ad8e753a16719b6f9396d88b313a5757f5ed4794 | [
"MIT"
] | null | null | null | Week06/q_cifar10_cnn.py | HowardNTUST/HackNTU_Data_2017 | ad8e753a16719b6f9396d88b313a5757f5ed4794 | [
"MIT"
] | null | null | null | Week06/q_cifar10_cnn.py | HowardNTUST/HackNTU_Data_2017 | ad8e753a16719b6f9396d88b313a5757f5ed4794 | [
"MIT"
] | 1 | 2019-02-24T17:41:45.000Z | 2019-02-24T17:41:45.000Z | import keras
from keras.layers import Dense, Activation, Conv2D, MaxPool2D, Reshape
model = Sequential()
model.add(Reshape((3, 32, 32), input_shape=(3*32*32,) ))
model.add(Conv2D(filters=32, kernel_size=(3,3), padding='same', activation="relu", data_format='channels_first'))
model.add(MaxPool2D())
model.add(Conv2D(filt... | 48.352941 | 113 | 0.723844 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 131 | 0.159367 |
8465fe705e2203a309cb2f80aab7f362306bc341 | 1,111 | py | Python | testesDuranteAulas/aula019.py | Igor3550/Exercicios-de-python | e0f6e043df4f0770ac15968485fbb19698b4ac6b | [
"MIT"
] | null | null | null | testesDuranteAulas/aula019.py | Igor3550/Exercicios-de-python | e0f6e043df4f0770ac15968485fbb19698b4ac6b | [
"MIT"
] | null | null | null | testesDuranteAulas/aula019.py | Igor3550/Exercicios-de-python | e0f6e043df4f0770ac15968485fbb19698b4ac6b | [
"MIT"
] | null | null | null | # Dicionarios
pessoas = {'nome': 'Igor', 'sexo': 'M', 'idade': 20}
print(f'O {pessoas["nome"]} tem {pessoas["idade"]} anos.')
print(pessoas.keys()) #chaves do dicionario
print(pessoas.values())#valores das chaves
print(pessoas.items())#mostra os itens do dicionario
print()
for k in pessoas.keys():
print(k)
for v in... | 26.452381 | 58 | 0.629163 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 414 | 0.371968 |
84664082e1511f1729add08f835b69444a8edf67 | 9,697 | py | Python | polyanalyst6api/api.py | Megaputer/polyanalyst6api-python | c6626a8a5f8f926b1f32285e18457ed70dfba73a | [
"MIT"
] | 2 | 2021-01-30T19:04:12.000Z | 2021-06-18T09:41:15.000Z | polyanalyst6api/api.py | Megaputer/polyanalyst6api-python | c6626a8a5f8f926b1f32285e18457ed70dfba73a | [
"MIT"
] | null | null | null | polyanalyst6api/api.py | Megaputer/polyanalyst6api-python | c6626a8a5f8f926b1f32285e18457ed70dfba73a | [
"MIT"
] | 1 | 2021-04-19T09:57:14.000Z | 2021-04-19T09:57:14.000Z | """
polyanalyst6api.api
~~~~~~~~~~~~~~~~~~~
This module contains functionality for access to PolyAnalyst API.
"""
import configparser
import contextlib
import pathlib
import warnings
from typing import Any, Dict, List, Tuple, Union, Optional
from urllib.parse import urljoin, urlparse
import requests
import urllib3
f... | 35.00722 | 113 | 0.608642 | 8,501 | 0.876663 | 0 | 0 | 1,815 | 0.187171 | 0 | 0 | 3,948 | 0.407136 |
ffbcc28e993823f93d8f7e3809b6abd49a5cc187 | 1,998 | py | Python | froide/publicbody/admin.py | rufuspollock/froide | 8ef4dbdd54a74f8c986d59e90348dfdbd85c5da4 | [
"MIT"
] | null | null | null | froide/publicbody/admin.py | rufuspollock/froide | 8ef4dbdd54a74f8c986d59e90348dfdbd85c5da4 | [
"MIT"
] | null | null | null | froide/publicbody/admin.py | rufuspollock/froide | 8ef4dbdd54a74f8c986d59e90348dfdbd85c5da4 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.http import HttpResponse
from django.utils.translation import ugettext as _
from froide.publicbody.models import (PublicBody, FoiLaw, PublicBodyTopic,
Jurisdiction)
class PublicBodyAdmin(admin.ModelAdmin):
prepopulated_fields = {
"slug": ("name",),
... | 34.448276 | 87 | 0.699199 | 1,564 | 0.782783 | 0 | 0 | 0 | 0 | 0 | 0 | 408 | 0.204204 |
ffbf148e7df59ebdd237d38695723231b7824b44 | 462 | py | Python | src/abc/106/106_b.py | ryuichi1208/atcoder_stack | 19ec81fb9a3edb44be422b79e98b23e8ff17ef60 | [
"MIT"
] | null | null | null | src/abc/106/106_b.py | ryuichi1208/atcoder_stack | 19ec81fb9a3edb44be422b79e98b23e8ff17ef60 | [
"MIT"
] | null | null | null | src/abc/106/106_b.py | ryuichi1208/atcoder_stack | 19ec81fb9a3edb44be422b79e98b23e8ff17ef60 | [
"MIT"
] | null | null | null | n = int(input())
# @return [0]:約数の個数 [1]:約数リスト
def divisor(num):
ret=[]
L=[]
for i in range(1,num+1):
if (num%i==0):
L.append(i)
ret.append(len(L))
ret.append(L)
return ret
L=[]
ans=0
for i in range(1,n+1):
if(i%2==0):
continue
else:
for j in range... | 14.4375 | 30 | 0.452381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 0.10166 |
ffbfef0bf96a36ae6a5da2b1bf0bdc5756f1e309 | 3,931 | py | Python | poc.py | evinr/basis-scraper | cb20574aadc469c6d1527ddb5a3cc69df531cbfd | [
"MIT"
] | null | null | null | poc.py | evinr/basis-scraper | cb20574aadc469c6d1527ddb5a3cc69df531cbfd | [
"MIT"
] | null | null | null | poc.py | evinr/basis-scraper | cb20574aadc469c6d1527ddb5a3cc69df531cbfd | [
"MIT"
] | null | null | null | import serial
def setup():
ser = serial.Serial('/dev/ttyUSB0', timeout=2)
ser.setRTS(True)
ser.setRTS(False)
if ser.isOpen():
ser.close()
ser.open()
ser.isOpen()
print "USB connection established"
def read():
rawString = ser.readline()
print rawString
return (str(rawString))
def write(string... | 27.110345 | 135 | 0.675401 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,067 | 0.780209 |
ffc0fbef26aaac232d9390250ce89e31f64b7ad8 | 31 | py | Python | multinet/db/models/__init__.py | multinet-app/multinet-girder | f34c87849d92c7fe2f8589760f97bebbe04bd4af | [
"Apache-2.0"
] | 3 | 2019-10-22T15:21:10.000Z | 2020-02-13T17:40:07.000Z | multinet/db/models/__init__.py | multinet-app/multinet | f34c87849d92c7fe2f8589760f97bebbe04bd4af | [
"Apache-2.0"
] | 183 | 2019-08-01T14:27:00.000Z | 2020-03-04T17:47:49.000Z | multinet/db/models/__init__.py | multinet-app/multinet-girder | f34c87849d92c7fe2f8589760f97bebbe04bd4af | [
"Apache-2.0"
] | 2 | 2020-08-20T11:57:17.000Z | 2020-11-10T22:54:19.000Z | """ORM models for multinet."""
| 15.5 | 30 | 0.645161 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 0.967742 |
ffc1536722c6684539bdbe4eaba7de45c07a8edb | 6,296 | py | Python | dataPipelines/gc_crawler/nato_stanag/models.py | ekmixon/gamechanger-crawlers | 60a0cf20338fb3dc134eec117bccd519cede9288 | [
"MIT"
] | null | null | null | dataPipelines/gc_crawler/nato_stanag/models.py | ekmixon/gamechanger-crawlers | 60a0cf20338fb3dc134eec117bccd519cede9288 | [
"MIT"
] | 4 | 2021-07-27T21:44:51.000Z | 2022-03-04T01:38:48.000Z | dataPipelines/gc_crawler/nato_stanag/models.py | ekmixon/gamechanger-crawlers | 60a0cf20338fb3dc134eec117bccd519cede9288 | [
"MIT"
] | null | null | null | import bs4
import os
import re
from typing import Iterable
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait # for implicit and explict waits
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from dataPipelines.gc_crawler... | 38.625767 | 127 | 0.550191 | 5,641 | 0.895966 | 628 | 0.099746 | 0 | 0 | 0 | 0 | 944 | 0.149936 |
ffc168320dcc3879d9935e0c48e2582d2d304fa1 | 3,938 | py | Python | app/signals.py | MakuZo/bloggy | 550e5285728b285e0d5243670d6aa0f40c414777 | [
"MIT"
] | 7 | 2018-11-12T20:52:53.000Z | 2021-12-17T23:04:41.000Z | app/signals.py | MakuZo/bloggy | 550e5285728b285e0d5243670d6aa0f40c414777 | [
"MIT"
] | 2 | 2019-12-24T08:53:51.000Z | 2019-12-26T19:26:51.000Z | app/signals.py | MakuZo/bloggy | 550e5285728b285e0d5243670d6aa0f40c414777 | [
"MIT"
] | 8 | 2018-12-28T12:31:51.000Z | 2020-01-25T09:07:52.000Z | import re
from django.db.models.signals import m2m_changed, post_save, pre_delete
from django.dispatch import receiver
from django.urls import reverse
from .models import Entry, Notification, User
@receiver(post_save, sender=Entry)
def entry_notification(sender, instance, created, **kwargs):
"""
Signal used... | 39.777778 | 127 | 0.561199 | 0 | 0 | 0 | 0 | 3,733 | 0.947943 | 0 | 0 | 976 | 0.247842 |
ffc1d0bbd0644054a0b22502249482b17c06c941 | 2,532 | py | Python | tests/utils/test_commons.py | jajomi/flow | c984be6f7de1a34192601c129dbc19f2ce45f135 | [
"Apache-2.0"
] | null | null | null | tests/utils/test_commons.py | jajomi/flow | c984be6f7de1a34192601c129dbc19f2ce45f135 | [
"Apache-2.0"
] | 6 | 2021-03-05T16:39:42.000Z | 2021-06-11T01:04:57.000Z | tests/utils/test_commons.py | jajomi/flow | c984be6f7de1a34192601c129dbc19f2ce45f135 | [
"Apache-2.0"
] | null | null | null | from unittest.mock import mock_open
from unittest.mock import patch
import flow.utils.commons as commons
def test_extract_story_id_with_empty_list():
story_list = commons.extract_story_id_from_commit_messages([])
assert len(story_list) == 0
commit_example = [
"223342f Adding ability to specify artifactory u... | 36.171429 | 100 | 0.781991 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,082 | 0.42733 |
ffc234c8fa1382a81cd3f2b1ea5e202da915c840 | 28,482 | py | Python | swagger_client/models/client_configuration.py | chbndrhnns/finapi-client | 259beda8b05e912c49d2dc4c3ed71205134e5d8a | [
"MIT"
] | 2 | 2019-04-15T05:58:21.000Z | 2021-11-15T18:26:37.000Z | swagger_client/models/client_configuration.py | chbndrhnns/finapi-client | 259beda8b05e912c49d2dc4c3ed71205134e5d8a | [
"MIT"
] | 1 | 2021-06-18T09:46:25.000Z | 2021-06-18T20:12:41.000Z | swagger_client/models/client_configuration.py | chbndrhnns/finapi-client | 259beda8b05e912c49d2dc4c3ed71205134e5d8a | [
"MIT"
] | 2 | 2019-07-08T13:41:09.000Z | 2020-12-07T12:10:04.000Z | # coding: utf-8
"""
finAPI RESTful Services
finAPI RESTful Services # noqa: E501
OpenAPI spec version: v1.42.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ClientConfiguration(object):
"""NOTE: This class is... | 71.027431 | 1,696 | 0.743066 | 28,222 | 0.990871 | 0 | 0 | 22,703 | 0.7971 | 0 | 0 | 20,786 | 0.729794 |
ffc35164c1764ae381a92d8e3682d0250a4793ea | 912 | py | Python | utils/jwt_custom_decorator.py | w0rm1995/face-comparison-backend | 9e231aabcf129e887e25a8ffdb5ae9617fee3e00 | [
"MIT"
] | null | null | null | utils/jwt_custom_decorator.py | w0rm1995/face-comparison-backend | 9e231aabcf129e887e25a8ffdb5ae9617fee3e00 | [
"MIT"
] | 3 | 2021-06-08T22:05:30.000Z | 2022-01-13T03:04:03.000Z | utils/jwt_custom_decorator.py | w0rm1995/face-comparison-backend | 9e231aabcf129e887e25a8ffdb5ae9617fee3e00 | [
"MIT"
] | null | null | null | from functools import wraps
from flask_jwt_extended import verify_jwt_in_request, get_jwt_claims, exceptions
from jwt import exceptions as jwt_exception
from utils.custom_response import bad_request
def admin_required(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
try:
verify_jwt_in_request... | 35.076923 | 80 | 0.638158 | 0 | 0 | 0 | 0 | 663 | 0.726974 | 0 | 0 | 104 | 0.114035 |
ffc40ad7630c4587dcf4487c052a523769c15b4a | 1,254 | py | Python | packages/M2Crypto-0.21.1/demo/smime/unsmime.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | null | null | null | packages/M2Crypto-0.21.1/demo/smime/unsmime.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | 6 | 2021-03-31T19:21:50.000Z | 2022-01-13T01:46:09.000Z | packages/M2Crypto-0.21.1/demo/smime/unsmime.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | null | null | null | #!/usr/bin/env python
"""S/MIME demo.
Copyright (c) 2000 Ng Pheng Siong. All rights reserved."""
from M2Crypto import BIO, Rand, SMIME, X509
import sys
def decrypt_verify(p7file, recip_key, signer_cert, ca_cert):
s = SMIME.SMIME()
# Load decryption private key.
s.load_key(recip_key)
# Extract PKCS... | 24.588235 | 77 | 0.6563 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 528 | 0.421053 |
ffc4351a518b97d5c4916014accd51d41d76de87 | 14,867 | py | Python | skybright/skybright.py | ehneilsen/skybright | b0e2d7e6e25131393ee76ce334ce1df1521e3659 | [
"MIT"
] | 1 | 2019-09-24T21:06:45.000Z | 2019-09-24T21:06:45.000Z | skybright/skybright.py | ehneilsen/skybright | b0e2d7e6e25131393ee76ce334ce1df1521e3659 | [
"MIT"
] | null | null | null | skybright/skybright.py | ehneilsen/skybright | b0e2d7e6e25131393ee76ce334ce1df1521e3659 | [
"MIT"
] | 1 | 2019-09-24T21:14:35.000Z | 2019-09-24T21:14:35.000Z | #!/usr/bin/env python
"""A model for the sky brightness
"""
from functools import partial
from math import pi, cos, acos, sin, sqrt, log10
from datetime import datetime, tzinfo, timedelta
from time import strptime
from calendar import timegm
from copy import deepcopy
from sys import argv
from collections import namedtu... | 37.1675 | 163 | 0.609807 | 5,700 | 0.383399 | 0 | 0 | 0 | 0 | 0 | 0 | 2,804 | 0.188606 |
ffc57756064cdbfdff55d925646e8ab713a50ba6 | 1,675 | py | Python | timeseries/test.py | zoobree/MachineLearning | 67fd35e67469d9f03afd5c090f2ca23f514bebfd | [
"Apache-2.0"
] | null | null | null | timeseries/test.py | zoobree/MachineLearning | 67fd35e67469d9f03afd5c090f2ca23f514bebfd | [
"Apache-2.0"
] | 1 | 2018-04-07T05:24:40.000Z | 2018-04-07T05:24:40.000Z | timeseries/test.py | joybree/MachineLearning | 69a381efa35436a6d211005c320576db966eea11 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import arima
import os
import pandas as pd
class Arima_Test(unittest.TestCase):
def set_data_dir(self):
print("set_data_dir")
self.dir = "E:/code/python/MachineLearning/data/test_data/"
self.error = 0.001
self.num_percent = 0.9
def t... | 25.769231 | 99 | 0.587463 | 1,541 | 0.92 | 0 | 0 | 0 | 0 | 0 | 0 | 188 | 0.112239 |
ffc7043d4112113fd11d3bba2367bfc4002daece | 8,004 | py | Python | pynetstation_send_tags/pynetstation_send_tags.py | mattmoo/Pynetstation-Plug-In | aba2d312e5543cc5c2100793805acfeff075c59c | [
"MIT"
] | null | null | null | pynetstation_send_tags/pynetstation_send_tags.py | mattmoo/Pynetstation-Plug-In | aba2d312e5543cc5c2100793805acfeff075c59c | [
"MIT"
] | null | null | null | pynetstation_send_tags/pynetstation_send_tags.py | mattmoo/Pynetstation-Plug-In | aba2d312e5543cc5c2100793805acfeff075c59c | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenSesame is distr... | 35.415929 | 115 | 0.594328 | 7,010 | 0.875812 | 0 | 0 | 0 | 0 | 0 | 0 | 3,536 | 0.441779 |
ffc7fe1be16dc65b683b9d6a05ef9740a31e195b | 42,563 | py | Python | ion/simulators/SBE37_SMP_simulator.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | 3 | 2016-09-20T09:50:06.000Z | 2018-08-10T01:41:38.000Z | ion/simulators/SBE37_SMP_simulator.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | null | null | null | ion/simulators/SBE37_SMP_simulator.py | ooici/coi-services | 43246f46a82e597345507afd7dfc7373cb346afa | [
"BSD-2-Clause"
] | 2 | 2016-03-16T22:25:49.000Z | 2016-11-26T14:54:21.000Z | #!/usr/bin/env python
__author__ = 'Roger Unwin'
import socket
import time
from time import gmtime, strftime
import datetime
import string
import sys
import random
import asyncore
import thread
import getopt
import select
import os
### default values defined below (b/c class is not yet defined)
#default_port = 4001 ... | 44.94509 | 405 | 0.453398 | 39,378 | 0.92517 | 0 | 0 | 0 | 0 | 0 | 0 | 10,079 | 0.236802 |
ffc857a75ba7aa5ef44304f6675fe0e78e0727a5 | 976 | py | Python | experiments/centralisation/centralisation.py | MichaelAllen1966/2105_london_acute_stroke_unit | 56b710c58b5b6bdf5c03e3fb9ec65c53cd5336ff | [
"MIT"
] | null | null | null | experiments/centralisation/centralisation.py | MichaelAllen1966/2105_london_acute_stroke_unit | 56b710c58b5b6bdf5c03e3fb9ec65c53cd5336ff | [
"MIT"
] | null | null | null | experiments/centralisation/centralisation.py | MichaelAllen1966/2105_london_acute_stroke_unit | 56b710c58b5b6bdf5c03e3fb9ec65c53cd5336ff | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
data = pd.read_csv('results.csv')
labels = [1,2,3,4]
width = 0.75
x = np.arange(len(labels)) # the label locations
fig = plt.figure(figsize=(9,6))
# Number people waiting
ax1 = fig.add_subplot(121)
y1 = data['av_waiting'].values.flatten()
w... | 21.217391 | 76 | 0.731557 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 334 | 0.342213 |
ffc9b886976a36f8168389759472ba04ff485037 | 10,360 | py | Python | Case_Study_1.py | Amritha29/Stout_DDA_FULL_STACK_21.github.io | 89be2324468dfba2ba9afb378881c6e9e460696b | [
"CC-BY-4.0"
] | null | null | null | Case_Study_1.py | Amritha29/Stout_DDA_FULL_STACK_21.github.io | 89be2324468dfba2ba9afb378881c6e9e460696b | [
"CC-BY-4.0"
] | null | null | null | Case_Study_1.py | Amritha29/Stout_DDA_FULL_STACK_21.github.io | 89be2324468dfba2ba9afb378881c6e9e460696b | [
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
Amritha Subburayan code for STOUT DDA FULL STACK CASE STUDIES
"""
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
from sklearn import preprocessing
import sklearn.metrics as sm
data = pd.r... | 32.888889 | 167 | 0.754826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,598 | 0.443822 |
ffcbaba69ba29dbe70293f1d332c038a6aaf91b9 | 1,373 | py | Python | datastore/__init__.py | Swixx/py-datastore | dfa1f9dcc3cc3beac3c3e79d085cb6e89da97a1c | [
"MIT"
] | 6 | 2019-08-04T04:11:36.000Z | 2020-02-20T17:10:26.000Z | datastore/__init__.py | Swixx/py-datastore | dfa1f9dcc3cc3beac3c3e79d085cb6e89da97a1c | [
"MIT"
] | 23 | 2019-09-17T11:35:06.000Z | 2020-04-07T16:18:15.000Z | datastore/__init__.py | Swixx/py-datastore | dfa1f9dcc3cc3beac3c3e79d085cb6e89da97a1c | [
"MIT"
] | 6 | 2019-08-04T02:02:25.000Z | 2020-03-01T15:43:41.000Z | """
Datastore is a generic layer of abstraction for data store and database access.
It is a **simple** API with the aim to enable application development in a
datastore-agnostic way, allowing datastores to be swapped seamlessly without
changing application code. Thus, one can leverage different datastores with
differen... | 29.212766 | 79 | 0.79024 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 780 | 0.568099 |
ffce3c914809fe508a87b5cc18e2cdab125e42d4 | 402 | py | Python | public_goods_str_nonoise/tests.py | bocchan/costly | ba52f82e36e28012a63a78805963bdf384679955 | [
"BSD-3-Clause"
] | null | null | null | public_goods_str_nonoise/tests.py | bocchan/costly | ba52f82e36e28012a63a78805963bdf384679955 | [
"BSD-3-Clause"
] | null | null | null | public_goods_str_nonoise/tests.py | bocchan/costly | ba52f82e36e28012a63a78805963bdf384679955 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
import random
from otree.common import Currency as c, currency_range
from . import views
from ._builtin import Bot
from .models import Constants
class PlayerBot(Bot):
"""Bot that plays one round"""
def play_round(self):
self.submit(views.MyPa... | 18.272727 | 54 | 0.691542 | 195 | 0.485075 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 0.131841 |
ffcf7b955b11391d80d86773ca0338d0d81e1b2c | 709 | py | Python | Dataset/Leetcode/test/56/463.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/56/463.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/test/56/463.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, intervals: List[List[int]]) -> List[List[int]]:
if len(intervals) == 1:
return intervals
intervals.sort()
result = [intervals[0]]
for i in range(1, len(intervals)):
# 总共三种情况需要考虑,比较两个区间,另两个区间中的元素值依次为a,b,c,d。
temp = res... | 32.227273 | 65 | 0.472496 | 812 | 0.996319 | 0 | 0 | 0 | 0 | 0 | 0 | 196 | 0.240491 |
ffd1926ccd96f4b70e990d54bad23c4b64c849e9 | 2,531 | py | Python | cloudianapi/tools/statistics.py | romerojunior/cloudian-api | f17b45653a0e3e27a78d0d6bdc094ec6ab521550 | [
"Apache-2.0"
] | 11 | 2017-11-01T17:48:10.000Z | 2020-08-25T04:29:17.000Z | cloudianapi/tools/statistics.py | romerojunior/cloudian-api | f17b45653a0e3e27a78d0d6bdc094ec6ab521550 | [
"Apache-2.0"
] | 5 | 2017-11-10T12:46:44.000Z | 2019-09-18T07:18:19.000Z | cloudianapi/tools/statistics.py | romerojunior/cloudian-api | f17b45653a0e3e27a78d0d6bdc094ec6ab521550 | [
"Apache-2.0"
] | 7 | 2018-01-26T20:08:37.000Z | 2021-05-26T14:32:06.000Z | #!/usr/bin/env python
# -*- coding:utf8 -*-
# Copyright 2017, Schuberg Philis BV
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership... | 34.202703 | 79 | 0.66772 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,971 | 0.778744 |
ffd4de322115b22ae4e36e0be2d07a40743376b4 | 1,340 | py | Python | users/models.py | connorgannaway/dockmate | 040d44cac896aabc1488f3ed9d59b417e20719d8 | [
"MIT"
] | null | null | null | users/models.py | connorgannaway/dockmate | 040d44cac896aabc1488f3ed9d59b417e20719d8 | [
"MIT"
] | null | null | null | users/models.py | connorgannaway/dockmate | 040d44cac896aabc1488f3ed9d59b417e20719d8 | [
"MIT"
] | null | null | null | from os import name
from django.db import models
from django.contrib.auth.models import User
from PIL import Image
#Model classes are tables objects in a database.
#each variable is a column and its datatype.
#__str__ method defines the name of a object (row) in a database table
#profile model is meant to be used as ... | 37.222222 | 92 | 0.709701 | 647 | 0.482836 | 0 | 0 | 0 | 0 | 0 | 0 | 735 | 0.548507 |
ffd544a103259a41233ed3e0af2e2d453a43568d | 1,446 | py | Python | E_ledproject.py | randomstring/raspberrypi | fe226ce33f116480bfea8f258fdffa1fd96e379c | [
"MIT"
] | null | null | null | E_ledproject.py | randomstring/raspberrypi | fe226ce33f116480bfea8f258fdffa1fd96e379c | [
"MIT"
] | null | null | null | E_ledproject.py | randomstring/raspberrypi | fe226ce33f116480bfea8f258fdffa1fd96e379c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import RPi.GPIO as GPIO
GPIO.setwarnings(False)
led_color_gpio = {
'yellow': 0,
'orange': 2,
'red': 3,
'green': 4,
'blue': 5,
'white': 6
}
buttons_gpio = {
'red': 28,
'blue': 29,
}
gpio_to_bcm = {
0: 17,
1: 18,
2: 27,
3: 22,
4: 23,
5:... | 18.075 | 54 | 0.538728 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 157 | 0.108575 |
ffd73066eb937a59b32d4daec9ba6f8807fa09da | 5,551 | py | Python | utils/StartMOOS.py | ianfixes/MOOS-python-utils | 1c34f3b8cde4fdcee48a8ee128a3c160eb17d722 | [
"WTFPL"
] | 3 | 2015-07-09T17:51:20.000Z | 2016-04-14T23:06:04.000Z | utils/StartMOOS.py | ifreecarve/MOOS-python-utils | 1c34f3b8cde4fdcee48a8ee128a3c160eb17d722 | [
"WTFPL"
] | null | null | null | utils/StartMOOS.py | ifreecarve/MOOS-python-utils | 1c34f3b8cde4fdcee48a8ee128a3c160eb17d722 | [
"WTFPL"
] | 3 | 2015-03-31T04:18:21.000Z | 2016-10-22T04:55:16.000Z | #!/usr/bin/env python
###########################################################################
#
# Written in 2009 by Ian Katz <ijk5@mit.edu>
# Terms: WTFPL (http://sam.zoy.org/wtfpl/)
# See COPYING and WARRANTY files included in this distribution
#
#####################################... | 26.816425 | 85 | 0.572149 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,091 | 0.376689 |
ffd92d23d660d2a840a6dec51a3209da982b029c | 1,172 | py | Python | word_vectorizer/tests/unittest/model_downloading/test_gensimModelDownloader.py | RodSernaPerez/WordVectorizer | 097b2ccfc284b39ad43f56047ee25e393b7525ec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | word_vectorizer/tests/unittest/model_downloading/test_gensimModelDownloader.py | RodSernaPerez/WordVectorizer | 097b2ccfc284b39ad43f56047ee25e393b7525ec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | word_vectorizer/tests/unittest/model_downloading/test_gensimModelDownloader.py | RodSernaPerez/WordVectorizer | 097b2ccfc284b39ad43f56047ee25e393b7525ec | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from unittest.mock import patch
from word_vectorizer.constants import Constants
from word_vectorizer.model_downloading.gensim_model_downloader import \
GensimModelDownloader
class TestGensimModelDownloader(TestCase):
NAME_MODEL = "name_model"
URL = "gensim"
PATH_WHERE_G... | 41.857143 | 77 | 0.728669 | 960 | 0.819113 | 0 | 0 | 723 | 0.616894 | 0 | 0 | 78 | 0.066553 |
ffd92f6660bddf66dfe789ef939a022a436eddba | 26,840 | py | Python | results/generate_result.py | riscv-android-src/platform-test-mlts-benchmark | fc22878823896b81eb8b7e63e952a13f9675edcb | [
"Apache-2.0"
] | null | null | null | results/generate_result.py | riscv-android-src/platform-test-mlts-benchmark | fc22878823896b81eb8b7e63e952a13f9675edcb | [
"Apache-2.0"
] | null | null | null | results/generate_result.py | riscv-android-src/platform-test-mlts-benchmark | fc22878823896b81eb8b7e63e952a13f9675edcb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
#
# Copyright 2018, The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 31.613663 | 99 | 0.656222 | 2,881 | 0.10734 | 0 | 0 | 0 | 0 | 0 | 0 | 9,619 | 0.358383 |
ffda91245aed33f9125784b3f0d5a73c6224af00 | 6,975 | py | Python | ampel/ztf/dev/DevSkyPortalClient.py | AmpelProject/Ampel-ZTF | 7f9736a7be3aa526571004716160cae2a800e410 | [
"BSD-3-Clause"
] | 1 | 2021-03-11T15:39:28.000Z | 2021-03-11T15:39:28.000Z | ampel/ztf/dev/DevSkyPortalClient.py | AmpelProject/Ampel-ZTF | 7f9736a7be3aa526571004716160cae2a800e410 | [
"BSD-3-Clause"
] | 18 | 2021-08-02T17:11:25.000Z | 2022-01-11T16:20:04.000Z | ampel/ztf/dev/DevSkyPortalClient.py | AmpelProject/Ampel-ZTF | 7f9736a7be3aa526571004716160cae2a800e410 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: Ampel-ZTF/ampel/ztf/dev/DevSkyPortalClient.py
# Author: Jakob van Santen <jakob.van.santen@desy.de>
# Date: 16.09.2020
# Last Modified Date: 16.09.2020
# Last Modified By: Jakob van Santen <jakob.van.santen@desy.de>
im... | 36.139896 | 151 | 0.531326 | 5,571 | 0.79871 | 819 | 0.117419 | 0 | 0 | 0 | 0 | 2,064 | 0.295914 |
ffddb9df1f192b673556f7659d2310d13ba94e89 | 3,806 | py | Python | tools/test_detection_features_converter.py | jialinwu17/caption_vqa | 9bbbb580d031a20ba4f18ef14fcd3599b62a482a | [
"MIT"
] | 139 | 2018-03-21T09:39:39.000Z | 2021-07-07T14:19:26.000Z | tools/test_detection_features_converter.py | VincentYing/Attention-on-Attention-for-VQA | cbc767541667e9bb32760ac7cd2e822eff232ff5 | [
"MIT"
] | 4 | 2018-05-25T05:15:20.000Z | 2018-10-11T00:52:14.000Z | tools/test_detection_features_converter.py | VincentYing/Attention-on-Attention-for-VQA | cbc767541667e9bb32760ac7cd2e822eff232ff5 | [
"MIT"
] | 23 | 2018-03-22T10:12:35.000Z | 2021-02-20T06:18:00.000Z | """
Reads in a tsv file with pre-trained bottom up attention features and
stores it in HDF5 format. Also store {image_id: feature_idx}
as a pickle file.
Hierarchy of HDF5 file:
{ 'image_features': num_images x num_boxes x 2048 array of features
'image_bb': num_images x num_boxes x 4 array of bounding boxes }
"""
... | 34.6 | 83 | 0.618497 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 772 | 0.202838 |
ffde4731dad77ca75123679807fabb3875a76017 | 176 | py | Python | src/registration/urls.py | jtrussell/swindle | 914f9ddc7b155cf895fc233b9f3f0c1804bf23e3 | [
"MIT"
] | 1 | 2021-04-07T20:14:43.000Z | 2021-04-07T20:14:43.000Z | src/registration/urls.py | jtrussell/swindle | 914f9ddc7b155cf895fc233b9f3f0c1804bf23e3 | [
"MIT"
] | null | null | null | src/registration/urls.py | jtrussell/swindle | 914f9ddc7b155cf895fc233b9f3f0c1804bf23e3 | [
"MIT"
] | null | null | null | from . import views
from django.urls import path
urlpatterns = [
path('', views.profile, name='profile'),
path('sign-up', views.sign_up, name='show_sign_up_form')
]
| 17.6 | 60 | 0.681818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 39 | 0.221591 |
ffde4e382f893654ea15768c8c27165eee09e3a4 | 3,720 | py | Python | src/Control/Sign.py | hieuhdh/Multi-tasking-program | 2f064a554f647247c84979b7a27f0797d1e1b5af | [
"MIT"
] | null | null | null | src/Control/Sign.py | hieuhdh/Multi-tasking-program | 2f064a554f647247c84979b7a27f0797d1e1b5af | [
"MIT"
] | null | null | null | src/Control/Sign.py | hieuhdh/Multi-tasking-program | 2f064a554f647247c84979b7a27f0797d1e1b5af | [
"MIT"
] | null | null | null | from tkinter.font import BOLD
from PIL import ImageTk
from tkinter import*
from PIL import Image
from tkinter import messagebox
from Tools.log_db import*
class Sign:
def __init__(self, root):
self.root = root
## Init frame and button
Frame_sign = Frame(self.root, bg="#120b26")
Fr... | 53.913043 | 265 | 0.596774 | 3,555 | 0.955645 | 0 | 0 | 0 | 0 | 0 | 0 | 880 | 0.236559 |
ffdf3cdd0117fb616bc6eff58d4c3d502c8bf807 | 6,301 | py | Python | aydin/it/classic_denoisers/bilateral.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 78 | 2021-11-08T16:11:23.000Z | 2022-03-27T17:51:04.000Z | aydin/it/classic_denoisers/bilateral.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 19 | 2021-11-08T17:15:40.000Z | 2022-03-30T17:46:55.000Z | aydin/it/classic_denoisers/bilateral.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 7 | 2021-11-09T17:42:32.000Z | 2022-03-09T00:37:57.000Z | from functools import partial
from typing import Optional, List, Tuple
import numpy
from numpy.typing import ArrayLike
from skimage.restoration import denoise_bilateral as skimage_denoise_bilateral
from aydin.it.classic_denoisers import _defaults
from aydin.util.crop.rep_crop import representative_crop
from aydin.uti... | 32.989529 | 83 | 0.690525 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,878 | 0.615458 |
ffe13b312ebb3748c1aadfdca895d3557dc9d9a9 | 1,889 | py | Python | pymon/pymon.py | crest42/PyMon | 96494cc37f906e6a07388af29b04c559ec72f116 | [
"MIT"
] | null | null | null | pymon/pymon.py | crest42/PyMon | 96494cc37f906e6a07388af29b04c559ec72f116 | [
"MIT"
] | null | null | null | pymon/pymon.py | crest42/PyMon | 96494cc37f906e6a07388af29b04c559ec72f116 | [
"MIT"
] | null | null | null | import logging
import time
from .exceptions import HostEntryNotValid
from .check import CheckFactory
from .alert import AlertFactory
from .host import Host
from .logging import logger
class PyMon:
def __init__(self, host_list, check_list, alert_list, daemonize=False):
self.hosts = {}
self.checks =... | 28.19403 | 75 | 0.564849 | 1,703 | 0.901535 | 0 | 0 | 0 | 0 | 0 | 0 | 84 | 0.044468 |
ffe516953bedc8e02aa7624b4a14d347ba8dad15 | 52,397 | py | Python | ambulance/tests/test_calls.py | aschrist/WebServerAndClient | 3aa0af2c444acac88a1b51b4cfd4bb8d0c36e640 | [
"BSD-3-Clause"
] | null | null | null | ambulance/tests/test_calls.py | aschrist/WebServerAndClient | 3aa0af2c444acac88a1b51b4cfd4bb8d0c36e640 | [
"BSD-3-Clause"
] | null | null | null | ambulance/tests/test_calls.py | aschrist/WebServerAndClient | 3aa0af2c444acac88a1b51b4cfd4bb8d0c36e640 | [
"BSD-3-Clause"
] | null | null | null | import logging
import time
from django.test import Client
from django.conf import settings
from django.urls import reverse
from django.db import IntegrityError
from django.utils import timezone
from rest_framework.parsers import JSONParser
from rest_framework import serializers
from io import BytesIO
import json
fr... | 37.533668 | 121 | 0.55444 | 51,579 | 0.984388 | 0 | 0 | 0 | 0 | 0 | 0 | 11,033 | 0.210565 |
ffe63e2dda8d22501b711fdd07b98a6cfff2ea5a | 2,484 | py | Python | bot/PythonProject/Commands.py | RamaDev09/CrateBot | 34b9f50b88da42cc1c449466402897340ec142df | [
"MIT"
] | null | null | null | bot/PythonProject/Commands.py | RamaDev09/CrateBot | 34b9f50b88da42cc1c449466402897340ec142df | [
"MIT"
] | null | null | null | bot/PythonProject/Commands.py | RamaDev09/CrateBot | 34b9f50b88da42cc1c449466402897340ec142df | [
"MIT"
] | null | null | null | import os
from bot.TextInput import TextInput
from bot.prompt import color_msg
def PythonCommands(file, name, category, description, slash):
here = os.getcwd()
# Writing a new import line
cogs = file['config']['commands'] = []
cogs.append(name)
with open(here + "/main.py", "r") as f :
... | 45.163636 | 118 | 0.517311 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 536 | 0.215781 |
ffe68f15e3bf96bdad0cec4870fd34ce0d8fbf6c | 223 | py | Python | src/methods/Addition.py | svanschooten/Flow | c7c158f986f7b108a255cbaa67ec7fff3518b637 | [
"MIT"
] | null | null | null | src/methods/Addition.py | svanschooten/Flow | c7c158f986f7b108a255cbaa67ec7fff3518b637 | [
"MIT"
] | null | null | null | src/methods/Addition.py | svanschooten/Flow | c7c158f986f7b108a255cbaa67ec7fff3518b637 | [
"MIT"
] | null | null | null | from methods.AbstactMethod import AbstractMethod
class Addition(AbstractMethod):
name = 'Addition'
def apply(self, args: dict) -> dict:
return {
'res': args.get('x') + args.get('y')
}
| 20.272727 | 48 | 0.591928 | 171 | 0.766816 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 0.09417 |
ffe7a09ec4555bf2573c09777fdb5c2946647fc9 | 3,914 | py | Python | submissions_comments.py | jbell1991/reddit-scraping | 73d88501ed0205e78000b9c30780a33186154fda | [
"MIT"
] | null | null | null | submissions_comments.py | jbell1991/reddit-scraping | 73d88501ed0205e78000b9c30780a33186154fda | [
"MIT"
] | null | null | null | submissions_comments.py | jbell1991/reddit-scraping | 73d88501ed0205e78000b9c30780a33186154fda | [
"MIT"
] | null | null | null | # imports
from decouple import config
import pandas as pd
import praw
import psycopg2
import schedule
from sqlalchemy import create_engine
import time
def job():
current_day = time.strftime("%m/%d/%Y")
print(f"Performing job on {current_day}")
startTime = time.time()
# connecting to reddit API
re... | 32.890756 | 93 | 0.667092 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,582 | 0.40419 |
ffe7fe43c53e89a050ea85e42fd101e3306b2423 | 9,139 | py | Python | vision_proc/proc_frame.py | SMS-Raiders/First2016 | a08eb1fa195bd869f8e7de7761d791e3fcf23d22 | [
"BSD-3-Clause"
] | 1 | 2016-03-08T14:39:52.000Z | 2016-03-08T14:39:52.000Z | vision_proc/proc_frame.py | SMS-Raiders/First2016 | a08eb1fa195bd869f8e7de7761d791e3fcf23d22 | [
"BSD-3-Clause"
] | null | null | null | vision_proc/proc_frame.py | SMS-Raiders/First2016 | a08eb1fa195bd869f8e7de7761d791e3fcf23d22 | [
"BSD-3-Clause"
] | null | null | null | #!/bin/python
#Frame processing and distance estimation for
#goal
#-------------------------------------------------------------------------------
# IMPORTS
#-------------------------------------------------------------------------------
import cv2
import math
import numpy
i... | 37.454918 | 135 | 0.402889 | 71 | 0.007769 | 0 | 0 | 0 | 0 | 0 | 0 | 4,636 | 0.507277 |
ffeabfb85c362b4fd5f28c9b1e056f66d191fed5 | 100 | py | Python | 9.py | sarika228/React-Projects | 24c342f71f839c257150f4b5e096c127b51d525c | [
"MIT"
] | null | null | null | 9.py | sarika228/React-Projects | 24c342f71f839c257150f4b5e096c127b51d525c | [
"MIT"
] | null | null | null | 9.py | sarika228/React-Projects | 24c342f71f839c257150f4b5e096c127b51d525c | [
"MIT"
] | null | null | null | i=1
while i<=4:
j=16
while j>=i:
print(i,end="")
j=j-1
print()
i=i+1 | 12.5 | 23 | 0.39 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0.02 |
ffeb87db7651191ea5cf19f49a0c7c9aa356f87d | 8,539 | py | Python | site-packages/playhouse/sqliteq.py | lego-cloud/MDMPy | dc676a5d2245a14b9b98a2ac2dba64ff0bf61800 | [
"Python-2.0",
"OLDAP-2.7"
] | 674 | 2015-11-06T04:22:47.000Z | 2022-02-26T17:31:43.000Z | site-packages/playhouse/sqliteq.py | lego-cloud/MDMPy | dc676a5d2245a14b9b98a2ac2dba64ff0bf61800 | [
"Python-2.0",
"OLDAP-2.7"
] | 713 | 2015-11-06T10:48:58.000Z | 2018-11-27T16:32:18.000Z | site-packages/playhouse/sqliteq.py | lego-cloud/MDMPy | dc676a5d2245a14b9b98a2ac2dba64ff0bf61800 | [
"Python-2.0",
"OLDAP-2.7"
] | 106 | 2015-12-07T11:21:06.000Z | 2022-03-11T10:58:41.000Z | import logging
import weakref
from threading import Event
from threading import Thread
try:
from Queue import Queue
except ImportError:
from queue import Queue
try:
import gevent
from gevent import Greenlet as GThread
from gevent.event import Event as GEvent
from gevent.queue import Queue as GQ... | 32.222642 | 79 | 0.610025 | 7,365 | 0.862513 | 0 | 0 | 260 | 0.030449 | 0 | 0 | 1,152 | 0.13491 |
ffed6941b3c99947e3e5d93c80fbd2e963b7ad51 | 9,056 | py | Python | Common/Db.py | StrawberryTeam/pi_robot | c1b8ce2ad49c64173673df0eb59e0941624556e7 | [
"MIT"
] | 2 | 2018-08-30T14:38:53.000Z | 2019-12-12T09:33:42.000Z | Common/Db.py | StrawberryTeam/pi_robot | c1b8ce2ad49c64173673df0eb59e0941624556e7 | [
"MIT"
] | 1 | 2018-12-10T05:15:48.000Z | 2018-12-10T05:15:48.000Z | Common/Db.py | StrawberryTeam/pi_robot | c1b8ce2ad49c64173673df0eb59e0941624556e7 | [
"MIT"
] | 2 | 2019-06-28T06:05:17.000Z | 2019-10-28T08:34:50.000Z | #!/usr/bin/python3
from Common.Straw import Straw
import pymongo
from pymongo import MongoClient
from bson.objectid import ObjectId
import os
class Db(Straw):
# 任务
_taskFields = {
'videoIds': 'string', #待操作的 视频
'setId': 'objectid', #待操作的视频集 id
'fromDevice': 'string',
'toDevice':... | 35.100775 | 169 | 0.597946 | 9,660 | 0.981508 | 0 | 0 | 0 | 0 | 0 | 0 | 3,741 | 0.380106 |
ffed95a551ec4c75f989589df7d781a9f4387728 | 1,251 | py | Python | baya/tests/test_templatetags.py | kreneskyp/baya | 5cf04b6873927124b4a3f24c113c08699dd61315 | [
"MIT"
] | 4 | 2016-05-24T13:57:37.000Z | 2020-02-27T05:22:56.000Z | baya/tests/test_templatetags.py | kreneskyp/baya | 5cf04b6873927124b4a3f24c113c08699dd61315 | [
"MIT"
] | 29 | 2016-02-05T01:31:51.000Z | 2022-02-23T18:50:58.000Z | baya/tests/test_templatetags.py | hrichards/baya | f319cef5e95cd6a166265d51ae0ea236b6f65be3 | [
"MIT"
] | 6 | 2016-05-20T22:22:45.000Z | 2019-09-03T17:57:59.000Z | from django.template import Context
from django.template import Template
from .test_base import LDAPGroupAuthTestBase
from django.contrib.auth.models import AnonymousUser
class CanUserPerformActionTagTest(LDAPGroupAuthTestBase):
BASIC_TEMPLATE = Template(
"{% load baya_tags %}"
"{% can_user_pe... | 29.785714 | 69 | 0.608313 | 1,077 | 0.860911 | 0 | 0 | 0 | 0 | 0 | 0 | 260 | 0.207834 |
fff185192df2e58db961f6b323cfb8259a7a9f46 | 2,611 | py | Python | egg/zoo/sum_game/architectures.py | CorentinKervadec/EGG | 5ccd49c4a493514b1194699954d41940f5e2a5c6 | [
"MIT"
] | null | null | null | egg/zoo/sum_game/architectures.py | CorentinKervadec/EGG | 5ccd49c4a493514b1194699954d41940f5e2a5c6 | [
"MIT"
] | null | null | null | egg/zoo/sum_game/architectures.py | CorentinKervadec/EGG | 5ccd49c4a493514b1194699954d41940f5e2a5c6 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
from torch.nn import functional as F
# In EGG, the game designer must implement the core functionality of t... | 44.254237 | 133 | 0.711222 | 1,207 | 0.462275 | 0 | 0 | 0 | 0 | 0 | 0 | 1,372 | 0.525469 |
fff18656fd42956b8ef43e1d1fc5a06b2aa15f66 | 2,757 | py | Python | utils/random_training_splits.py | suvarnak/GenerativeFSLCovid | 0bdeb4ed444c5c9d59697c71d0733fc3a100944c | [
"MIT"
] | null | null | null | utils/random_training_splits.py | suvarnak/GenerativeFSLCovid | 0bdeb4ed444c5c9d59697c71d0733fc3a100944c | [
"MIT"
] | null | null | null | utils/random_training_splits.py | suvarnak/GenerativeFSLCovid | 0bdeb4ed444c5c9d59697c71d0733fc3a100944c | [
"MIT"
] | null | null | null | import os
import shutil
import random
def copy_random_k_files(src_dir, k, dst_dir):
file_list = os.listdir(src_dir)
if k == -1:
k=len(file_list)
for i in range(k):
random_file=random.choice(file_list)
print(random_file)
src1 = os.path.join(src_dir, random_file)
dst... | 39.385714 | 105 | 0.673921 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 258 | 0.09358 |
fff197ae68beb5dbb26583494df00c1fc7732948 | 1,285 | py | Python | tools/gen_bbox_ac.py | vincentzhang/faster-rcnn-fcn | 7118d715a430f0ec2697e5f7a9a39c9752b466da | [
"BSD-2-Clause"
] | 7 | 2019-07-19T21:30:26.000Z | 2021-06-17T03:57:22.000Z | tools/gen_bbox_ac.py | vincentzhang/faster-rcnn-fcn | 7118d715a430f0ec2697e5f7a9a39c9752b466da | [
"BSD-2-Clause"
] | null | null | null | tools/gen_bbox_ac.py | vincentzhang/faster-rcnn-fcn | 7118d715a430f0ec2697e5f7a9a39c9752b466da | [
"BSD-2-Clause"
] | 1 | 2021-06-17T03:57:23.000Z | 2021-06-17T03:57:23.000Z | # generated bbox ground truth from pixel-wise segmentation
# it currently only generate one bbox
from __future__ import print_function
import numpy as np
import h5py
import os
import pdb
mask_path = '../data/acce'
f = h5py.File(os.path.join(mask_path, "resized_label_ac_2d.h5"), 'r')
bbox_path = '../data/acce/bbox'
if... | 34.72973 | 83 | 0.585214 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 430 | 0.33463 |
fff2144edf1dc7c96f337289635ef5af44b23625 | 8,510 | py | Python | testscript/imputation_algorithms.py | zshufan/Tattle-Tale | f9d93051efb523f1bda0cead023c2f001e18cc85 | [
"BSD-3-Clause"
] | null | null | null | testscript/imputation_algorithms.py | zshufan/Tattle-Tale | f9d93051efb523f1bda0cead023c2f001e18cc85 | [
"BSD-3-Clause"
] | null | null | null | testscript/imputation_algorithms.py | zshufan/Tattle-Tale | f9d93051efb523f1bda0cead023c2f001e18cc85 | [
"BSD-3-Clause"
] | null | null | null | # some codes refer to Holoclean evaluation function
# https://github.com/HoloClean/holoclean
import pandas as pd
import numpy as np
import logging
import random
import argparse
parser = argparse.ArgumentParser(description='Predict on many examples')
parser.add_argument("--dataset", type=str, help="dataset path")
pars... | 42.338308 | 169 | 0.602115 | 7,412 | 0.870975 | 0 | 0 | 0 | 0 | 0 | 0 | 2,235 | 0.262632 |
fff27be5ec642c73c3bac5ec2ecda165d7fe17c5 | 145 | py | Python | Hackerrank_python/15.numpy/10.Min and Max.py | manish1822510059/Hackerrank | 7c6e4553f033f067e04dc6c756ef90cb43f3c4a8 | [
"MIT"
] | 39 | 2020-09-27T05:32:05.000Z | 2022-01-08T18:04:05.000Z | Hackerrank_python/15.numpy/10.Min and Max.py | manish1822510059/Hackerrank | 7c6e4553f033f067e04dc6c756ef90cb43f3c4a8 | [
"MIT"
] | 5 | 2020-10-02T13:33:00.000Z | 2021-03-01T14:06:08.000Z | Hackerrank_python/15.numpy/10.Min and Max.py | manish1822510059/Hackerrank | 7c6e4553f033f067e04dc6c756ef90cb43f3c4a8 | [
"MIT"
] | 6 | 2020-10-03T04:04:55.000Z | 2021-10-18T04:07:53.000Z | import numpy as arr
n,m=map(int,input().split())
ar=([list(map(int,input().split()))for _ in range(n)])
arr1=arr.min(ar,axis=1)
print(max(arr1))
| 24.166667 | 54 | 0.668966 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fff3557fd7e005babefb16e3b6b117ef8a3354ec | 918 | py | Python | file_automation.py | FlightDev/YSPA | 5226712ebf305e7a3c686c43c996517a617f748b | [
"MIT"
] | null | null | null | file_automation.py | FlightDev/YSPA | 5226712ebf305e7a3c686c43c996517a617f748b | [
"MIT"
] | null | null | null | file_automation.py | FlightDev/YSPA | 5226712ebf305e7a3c686c43c996517a617f748b | [
"MIT"
] | null | null | null | import os
import glob
from astropy.io import fits
#/home/student/Desktop/Images/iTelescope/20180716-California-T24-GOOD
# Yo Neal. When you use this program, you have to change a few things between iTelescope and LFOP
# FIRST, remember to change the file path or you'll be a dummy. Also for LFOP -13 and -12 while
... | 32.785714 | 99 | 0.667756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 476 | 0.518519 |
fff3dd07c2f6cdec73bcd25788a20c7594c2652d | 959 | py | Python | streamlit/main.py | prakhar134/clean-or-messy | 0b9080363c48ca9cff0449875dfcbd169ef64321 | [
"MIT"
] | 13 | 2020-10-08T13:52:21.000Z | 2022-03-11T07:02:35.000Z | streamlit/main.py | architsharmaa/clean-or-messy | b40028cb4c4c8bbefb91a4b016096953b445c146 | [
"MIT"
] | null | null | null | streamlit/main.py | architsharmaa/clean-or-messy | b40028cb4c4c8bbefb91a4b016096953b445c146 | [
"MIT"
] | 9 | 2020-10-08T12:02:50.000Z | 2022-01-25T23:38:46.000Z | from fastai.vision.all import *
from PIL import Image
import streamlit as st
import numpy as np
from io import BytesIO
from .config import imgWidth, imgHeight
st.title("CleanvsMessy")
st.markdown('''
## Upload the image''',True)
st.set_option('deprecation.showfileUploaderEncoding', False)
file = st.file_uploader(" ")
... | 30.935484 | 65 | 0.683003 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 222 | 0.231491 |
fff46233cd9fc6a4821a3755e7bb2b8fd09e058e | 1,030 | py | Python | read_trials.py | Volkarl/P10-ExoskeletonTransferLearning | 311daf3791c65838ff9c496eeb6526b096b41d4c | [
"MIT"
] | null | null | null | read_trials.py | Volkarl/P10-ExoskeletonTransferLearning | 311daf3791c65838ff9c496eeb6526b096b41d4c | [
"MIT"
] | 2 | 2020-11-13T18:39:27.000Z | 2021-08-25T15:59:36.000Z | read_trials.py | Volkarl/P10-ExoskeletonTransferLearning | 311daf3791c65838ff9c496eeb6526b096b41d4c | [
"MIT"
] | null | null | null | import pickle
import matplotlib.pyplot as plt
import pandas as pd
trials = pickle.load(open("trials.p", "rb"))
print("Set breakpoint here")
#for item in trials.trials:
# args = item["vals"]
# res = item["result"]["loss"]
#itemtuples = [(item["misc"]["vals"]["dilation_group"], item["misc"]["vals"]["use_ref_po... | 24.52381 | 146 | 0.635922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 694 | 0.673786 |
fff5f55a4eee57bae636a577f32adbde97ba453e | 3,151 | py | Python | e3/provisioning/AtlassianAwsSecurity.py | sguillory6/e3 | 1505e6ea389157b9645155b9da13d6d316235f1a | [
"Apache-2.0"
] | null | null | null | e3/provisioning/AtlassianAwsSecurity.py | sguillory6/e3 | 1505e6ea389157b9645155b9da13d6d316235f1a | [
"Apache-2.0"
] | null | null | null | e3/provisioning/AtlassianAwsSecurity.py | sguillory6/e3 | 1505e6ea389157b9645155b9da13d6d316235f1a | [
"Apache-2.0"
] | null | null | null | import logging
import logging.config
import os
import subprocess
from datetime import datetime, timedelta
from botocore.credentials import CredentialProvider, RefreshableCredentials
from dateutil.tz import tzlocal
from common.E3 import e3
class AtlassianAwsSecurity(CredentialProvider):
"""
This class is onl... | 39.886076 | 114 | 0.614408 | 2,906 | 0.922247 | 0 | 0 | 0 | 0 | 0 | 0 | 658 | 0.208823 |
fff5fae09ca4ba6758cfde4e7471355a0e7af098 | 3,506 | py | Python | RecRoomAnimatedProfilePicture.py | zigzatuzoo/Rec-Room-Animated-Profile-Picture | b8eeabf478613f47d3bdb9195ad2f5051e7aaaad | [
"Apache-2.0"
] | 4 | 2021-08-17T01:13:03.000Z | 2022-03-19T04:03:01.000Z | RecRoomAnimatedProfilePicture.py | zigzatuzoo/Rec-Room-Animated-Profile-Picture | b8eeabf478613f47d3bdb9195ad2f5051e7aaaad | [
"Apache-2.0"
] | null | null | null | RecRoomAnimatedProfilePicture.py | zigzatuzoo/Rec-Room-Animated-Profile-Picture | b8eeabf478613f47d3bdb9195ad2f5051e7aaaad | [
"Apache-2.0"
] | null | null | null | ''' Stuff you need to update for this to work '''
'Enter your username here'
user = ''
'Enter your password here'
passwd = ''
image1 = '2d83af05944d49c69fa9565fb238a91b.jpg'
image2 = '49b2788b672e4088a25eb0a9eff35c17.jpg'
image3 = '355c2c7e87f0489bb5f0308cdec108f6.jpg'
" ^ You need to change EACH of these to whateve... | 35.77551 | 287 | 0.634341 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,150 | 0.613234 |
fff7d77cd5951c966e8c3d645997399fd6e953c2 | 14,121 | py | Python | rcommander/src/rcommander/graph_view.py | rummanwaqar/rcommander-core | 7106d5868db76c47dea6ad11118a54351a8bd390 | [
"BSD-3-Clause"
] | 4 | 2015-04-08T09:57:43.000Z | 2021-08-12T01:44:37.000Z | rcommander/src/rcommander/graph_view.py | jhu-lcsr-forks/rcommander-core | 1a0350e9b93687eff6a4407f72b5250be5f56919 | [
"BSD-3-Clause"
] | 1 | 2015-03-12T09:10:27.000Z | 2015-03-12T09:10:27.000Z | rcommander/src/rcommander/graph_view.py | jhu-lcsr-forks/rcommander-core | 1a0350e9b93687eff6a4407f72b5250be5f56919 | [
"BSD-3-Clause"
] | 3 | 2015-03-12T10:59:17.000Z | 2021-06-21T02:13:57.000Z | #import roslib; roslib.load_manifest('rcommander_core')
import graph.style as gs
import graph
import graph.layout as gl
import tool_utils as tu
import graph_model as gm
import numpy as np
import time
import copy
def copy_style(astyle, bstyle):
bstyle.background = astyle.background
bstyle.fill = as... | 39.116343 | 146 | 0.578217 | 13,430 | 0.951066 | 0 | 0 | 0 | 0 | 0 | 0 | 2,336 | 0.165427 |
fff91c879216ac70a7559f58214c7d1b3892a9ea | 3,264 | py | Python | django_input_collection/api/restframework/collection.py | pivotal-energy-solutions/django-input-collection | cc2ce3e0a7104ba9c524eaba5706da94ddb04a5f | [
"Apache-2.0"
] | null | null | null | django_input_collection/api/restframework/collection.py | pivotal-energy-solutions/django-input-collection | cc2ce3e0a7104ba9c524eaba5706da94ddb04a5f | [
"Apache-2.0"
] | 4 | 2019-08-25T15:47:24.000Z | 2022-03-24T19:35:09.000Z | django_input_collection/api/restframework/collection.py | pivotal-energy-solutions/django-input-collection | cc2ce3e0a7104ba9c524eaba5706da94ddb04a5f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.urls import reverse
from rest_framework.response import Response
from rest_framework import status
from ...collection import BaseAPICollector, BaseAPISpecification
from ... import models
from . import serializers
class RestFrameworkSpecification(BaseAPISpecification):
content... | 38.857143 | 99 | 0.662377 | 3,007 | 0.921262 | 0 | 0 | 0 | 0 | 0 | 0 | 1,036 | 0.317402 |
fffc90bcd5aabe8c07f5b2517e1c835715addf0e | 770 | py | Python | DFS/depth_first_search.py | Quanta-Algorithm-Design/graphs | 3a5b6362bf60a1e2fb06d2fadab46e72124d637d | [
"MIT"
] | null | null | null | DFS/depth_first_search.py | Quanta-Algorithm-Design/graphs | 3a5b6362bf60a1e2fb06d2fadab46e72124d637d | [
"MIT"
] | null | null | null | DFS/depth_first_search.py | Quanta-Algorithm-Design/graphs | 3a5b6362bf60a1e2fb06d2fadab46e72124d637d | [
"MIT"
] | 1 | 2020-10-05T06:46:13.000Z | 2020-10-05T06:46:13.000Z | #!/usr/bin/env python3
"""
This module defines functions for depth-first-search in a graph with a given adjacency list
"""
def dfs_visit(node_list, adj_list, root_node, parent):
"""
Takes the graph node list, its adj list, and a node s,
and visits all the nodes reachable from s recursively.
"""
fo... | 29.615385 | 91 | 0.654545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 325 | 0.422078 |
ffff1e4cd8bc9bad42ca402b2c639f4b45a16abe | 791 | py | Python | pirates/quest/QuestHolderBase.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 3 | 2021-02-25T06:38:13.000Z | 2022-03-22T07:00:15.000Z | pirates/quest/QuestHolderBase.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | null | null | null | pirates/quest/QuestHolderBase.py | itsyaboyrocket/pirates | 6ca1e7d571c670b0d976f65e608235707b5737e3 | [
"BSD-3-Clause"
] | 1 | 2021-02-25T06:38:17.000Z | 2021-02-25T06:38:17.000Z | # uncompyle6 version 3.2.0
# Python bytecode 2.4 (62061)
# Decompiled from: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)]
# Embedded file name: pirates.quest.QuestHolderBase
class QuestHolderBase:
__module__ = __name__
def __init__(self):
self._rewardCollectors... | 30.423077 | 104 | 0.694058 | 575 | 0.726928 | 0 | 0 | 0 | 0 | 0 | 0 | 234 | 0.295828 |
0803020bd1e3c35bd9b149aea49e7ac12f9623a3 | 933 | py | Python | setup.py | yihong0618/-nbnhhsh-cli | 3c8241dbc772b4b693e06b350c4351e75572596a | [
"Apache-2.0"
] | 33 | 2021-07-09T05:40:00.000Z | 2022-02-07T12:49:34.000Z | setup.py | yihong0618/-nbnhhsh-cli | 3c8241dbc772b4b693e06b350c4351e75572596a | [
"Apache-2.0"
] | 1 | 2021-07-09T05:37:02.000Z | 2021-07-09T05:37:02.000Z | setup.py | yihong0618/-nbnhhsh-cli | 3c8241dbc772b4b693e06b350c4351e75572596a | [
"Apache-2.0"
] | 2 | 2021-07-10T10:25:08.000Z | 2021-07-11T03:16:38.000Z | from setuptools import setup, find_packages
VERSION = "0.1.1"
setup(
name="hhsh",
version=VERSION,
description="能不能好好说话? cli",
long_description="能不能好好说话? cli",
keywords="python hhsh cli terminal",
author="itorr,yihong0618",
author_email="zouzou0208@gmail.com",
url="https://github.com/y... | 29.15625 | 53 | 0.621651 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 517 | 0.535751 |
08058658e2bf102d2ac28a2a02f1701e1eb02d65 | 937 | py | Python | container/base/src/cache.py | hmrc/devops-tooling-build | 03d62df3a45d5dcce306cd6cad6c95a24a4b34ab | [
"Apache-2.0"
] | 1 | 2021-11-10T16:09:43.000Z | 2021-11-10T16:09:43.000Z | container/base/src/cache.py | hmrc/devops-tooling-build | 03d62df3a45d5dcce306cd6cad6c95a24a4b34ab | [
"Apache-2.0"
] | 6 | 2021-07-02T14:15:25.000Z | 2022-02-03T12:57:36.000Z | container/base/src/cache.py | hmrc/devops-tooling-build | 03d62df3a45d5dcce306cd6cad6c95a24a4b34ab | [
"Apache-2.0"
] | null | null | null | import datetime
import hashlib
import os
import pathlib
from typing import Optional
import yaml
def key(name):
return hashlib.sha1(name.encode()).hexdigest()
def path(name):
return pathlib.Path(os.environ['CACHE_AWS_MNT']) / key(name)
def aws_get(name) -> Optional[dict]:
try:
with path(name)... | 25.324324 | 78 | 0.649947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 107 | 0.113951 |
08075a784b23b26531f0e2fcf4a1653e8cbbe078 | 1,118 | py | Python | tests/test_blender.py | dumpmemory/lassl | dfe56f09cc2ade6c777ad8561b24f23d83a34188 | [
"Apache-2.0"
] | null | null | null | tests/test_blender.py | dumpmemory/lassl | dfe56f09cc2ade6c777ad8561b24f23d83a34188 | [
"Apache-2.0"
] | null | null | null | tests/test_blender.py | dumpmemory/lassl | dfe56f09cc2ade6c777ad8561b24f23d83a34188 | [
"Apache-2.0"
] | null | null | null | from collections import Counter
import pytest
from datasets import load_dataset
from lassl.blender import DatasetBlender
def test_blending():
try:
from langid import classify
except ImportError as _:
raise ImportError(
"To test dataset blending, you need to install langid. "
... | 30.216216 | 82 | 0.620751 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 297 | 0.265653 |
080796109f90dd5533115b48ae3a4657f5fb4224 | 4,542 | py | Python | wisps/data_analysis/path_parser.py | caganze/WISPS | 81b91f8b49c7345ab68b7c4eb480716985e8905c | [
"MIT"
] | null | null | null | wisps/data_analysis/path_parser.py | caganze/WISPS | 81b91f8b49c7345ab68b7c4eb480716985e8905c | [
"MIT"
] | 7 | 2021-02-02T21:51:56.000Z | 2022-01-13T00:57:45.000Z | wisps/data_analysis/path_parser.py | caganze/wisps | 6572201f94a6af6d1c0a306f2f447215d4330bd7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
After the introduction of version 6.2, all wisp data and hst-3d are now on MAST
3D-HST has not added any new data nor changed their directory structure,
but that's not the case for WISP
Aim: parse new directories to make them compatible with v5.0
"""
import os
import glob
from ..utils... | 34.409091 | 170 | 0.647952 | 0 | 0 | 0 | 0 | 4,142 | 0.911933 | 0 | 0 | 1,986 | 0.437252 |
08092e15e7923e75bbc9274300846c3ee3fbd2d9 | 158 | py | Python | tests/utils/TestTransaction.py | Shaid3r/reservations | 43e17ae88eed74593879f9f8c5a9bed7252888f7 | [
"MIT"
] | null | null | null | tests/utils/TestTransaction.py | Shaid3r/reservations | 43e17ae88eed74593879f9f8c5a9bed7252888f7 | [
"MIT"
] | null | null | null | tests/utils/TestTransaction.py | Shaid3r/reservations | 43e17ae88eed74593879f9f8c5a9bed7252888f7 | [
"MIT"
] | null | null | null | import storage
import pytest
class TestTransaction:
@pytest.fixture(autouse=True)
def transact(self):
yield
storage.conn.rollback()
| 15.8 | 33 | 0.683544 | 126 | 0.797468 | 65 | 0.411392 | 99 | 0.626582 | 0 | 0 | 0 | 0 |
080b1f9b578c418d65d4a8c4119d27d86ab70fa5 | 2,451 | py | Python | aldryn_redirects/migrations/0003_auto_20171206_1150.py | compoundpartners/aldryn-redirects | ed1b1e90a7774a4bead771e158e30d5846e64e60 | [
"BSD-3-Clause"
] | 1 | 2020-05-14T06:41:50.000Z | 2020-05-14T06:41:50.000Z | aldryn_redirects/migrations/0003_auto_20171206_1150.py | compoundpartners/aldryn-redirects | ed1b1e90a7774a4bead771e158e30d5846e64e60 | [
"BSD-3-Clause"
] | 11 | 2016-01-11T11:42:58.000Z | 2018-11-05T16:13:27.000Z | aldryn_redirects/migrations/0003_auto_20171206_1150.py | compoundpartners/aldryn-redirects | ed1b1e90a7774a4bead771e158e30d5846e64e60 | [
"BSD-3-Clause"
] | 6 | 2016-11-22T04:53:37.000Z | 2018-11-15T13:56:39.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2017-12-06 13:50
from __future__ import unicode_literals
import aldryn_redirects.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),... | 50.020408 | 268 | 0.651571 | 2,225 | 0.907793 | 0 | 0 | 0 | 0 | 0 | 0 | 850 | 0.346797 |
0811b7481588bc53cfde102ac50bffe1f9e0e41c | 161 | py | Python | velocity/constants.py | aisthesis/mfstockmkt | d442ec4cb3b379f6984397926b4466420236c032 | [
"MIT"
] | null | null | null | velocity/constants.py | aisthesis/mfstockmkt | d442ec4cb3b379f6984397926b4466420236c032 | [
"MIT"
] | 1 | 2015-12-27T17:37:54.000Z | 2015-12-31T05:06:06.000Z | velocity/constants.py | aisthesis/mfstockmkt | d442ec4cb3b379f6984397926b4466420236c032 | [
"MIT"
] | 1 | 2020-05-02T08:25:35.000Z | 2020-05-02T08:25:35.000Z | """
.. Copyright (c) 2015 Marshall Farrier
license http://opensource.org/licenses/MIT
Constants
=========
"""
UPVEL_COL = 'Up Vel'
DOWNVEL_COL = 'Down Vel'
| 14.636364 | 45 | 0.652174 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 131 | 0.813665 |
0811dfdcb7e741d544fe728950a10ae174c04263 | 3,284 | py | Python | fileForRepair/src/parking.py | ChangSeonKim/5G_UWC_project | 0504a1b1ed30787f30e18a178897978de55660ef | [
"Apache-2.0"
] | null | null | null | fileForRepair/src/parking.py | ChangSeonKim/5G_UWC_project | 0504a1b1ed30787f30e18a178897978de55660ef | [
"Apache-2.0"
] | null | null | null | fileForRepair/src/parking.py | ChangSeonKim/5G_UWC_project | 0504a1b1ed30787f30e18a178897978de55660ef | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import LaserScan
import numpy as np
import math
from std_msgs.msg import String
def callback(data):
laser_arr_f = np.array(data.ranges[0:10])
laser_arr_l= np.array(data.ranges[85:95])
laser_arr_r = np.array(d... | 29.061947 | 76 | 0.546894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,268 | 0.386114 |
08138545899e44b68cb9f2c6902d9d5be0b380f7 | 2,622 | py | Python | opennsa/provreg.py | jmacauley/opennsa | 853c0fc8e065e74815cbc3f769939f64ac6aadeb | [
"BSD-3-Clause"
] | null | null | null | opennsa/provreg.py | jmacauley/opennsa | 853c0fc8e065e74815cbc3f769939f64ac6aadeb | [
"BSD-3-Clause"
] | null | null | null | opennsa/provreg.py | jmacauley/opennsa | 853c0fc8e065e74815cbc3f769939f64ac6aadeb | [
"BSD-3-Clause"
] | null | null | null | """
Registry for tracking providers dynamically in OpenNSA.
Keeping track of providers in a dynamical way in an NSI implementation is a
huge pain in the ass. This is a combination of things, such as seperate
identities and endpoints, callbacks, and the combination of local providers.
The class ProviderRegistry tries ... | 34.051948 | 108 | 0.672006 | 2,179 | 0.831045 | 0 | 0 | 0 | 0 | 0 | 0 | 1,025 | 0.390923 |
081559dc3ab661ae3a1df9c2d52bc8d2ba1f2ae4 | 997 | py | Python | tests/test_task_tracker.py | jmchilton/shedclient-beta | 50041b488652f8bf40555b0c1ef001290f1c3f6a | [
"CC-BY-3.0"
] | 2 | 2015-12-21T02:18:54.000Z | 2016-09-08T13:56:36.000Z | tests/test_task_tracker.py | jmchilton/shedclient-beta | 50041b488652f8bf40555b0c1ef001290f1c3f6a | [
"CC-BY-3.0"
] | 1 | 2015-12-21T19:26:21.000Z | 2015-12-21T19:26:21.000Z | tests/test_task_tracker.py | jmchilton/shedclient-beta | 50041b488652f8bf40555b0c1ef001290f1c3f6a | [
"CC-BY-3.0"
] | null | null | null | from test_utils import TempDirectoryContext
from shedclient import task_tracker
def test_task_tracker():
with TempDirectoryContext() as context:
config = dict(
task_tracking_directory=context.temp_directory
)
tracker = task_tracker.build_task_tracker(config)
assert len... | 33.233333 | 76 | 0.657974 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 94 | 0.094283 |
081691097da1b52252fbbf22f08b3e7856a39982 | 5,825 | py | Python | gonder_rc.py | TarikCinar/python-sesli-asistan | 1a29a8d3081b67ff352cf03f7b01ac01b7118deb | [
"MIT"
] | 1 | 2021-05-28T17:27:50.000Z | 2021-05-28T17:27:50.000Z | gonder_rc.py | TarikCinar/python-sesli-asistan | 1a29a8d3081b67ff352cf03f7b01ac01b7118deb | [
"MIT"
] | null | null | null | gonder_rc.py | TarikCinar/python-sesli-asistan | 1a29a8d3081b67ff352cf03f7b01ac01b7118deb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.13.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x04\x1a\
\x00\
\x01\x08\x3e\x78\x9c\xed\x9c\x4d\x6e\xd3\x50\x14\x85\x1d\x65\x10\
\x66\x61\xc4\x... | 47.357724 | 103 | 0.72721 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,200 | 0.892704 |
081745d5d369bb388f32e0870139795f7243852c | 213 | py | Python | tuples-and-sets/3_unique_names.py | Minkov/python-advanced-2020-01 | f2ee26f1325d943529673457a1cbba5657ae5905 | [
"MIT"
] | 5 | 2020-01-16T18:17:08.000Z | 2020-04-12T06:42:47.000Z | tuples-and-sets/3_unique_names.py | Minkov/python-advanced-2020-01 | f2ee26f1325d943529673457a1cbba5657ae5905 | [
"MIT"
] | null | null | null | tuples-and-sets/3_unique_names.py | Minkov/python-advanced-2020-01 | f2ee26f1325d943529673457a1cbba5657ae5905 | [
"MIT"
] | null | null | null | n = int(input())
# names = {input() for _ in range(n)}
names = []
for _ in range(n):
names.append(input())
unique_names = list(set(names))
[print(name)
for name
in sorted(unique_names, key=names.index)]
| 15.214286 | 42 | 0.643192 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 37 | 0.173709 |
081c3a4e5b548789411fc11be988031444e552dd | 233 | py | Python | dialogue/tensorflow/task/common/common.py | ishine/nlp-dialogue | d47c1438cb5c45c2c2aebfb82fea92bef4c3d65c | [
"Apache-2.0"
] | 478 | 2020-10-28T01:30:30.000Z | 2022-03-30T06:34:07.000Z | paper-code/tensorflow_src/models/task/common/common.py | HengYongChao/nlp-paper | fcf985e3c9bfd6944d07c4c36afbaee3384d040d | [
"Apache-2.0"
] | 1 | 2021-08-29T11:55:09.000Z | 2021-11-04T09:25:19.000Z | paper-code/tensorflow_src/models/task/common/common.py | HengYongChao/nlp-paper | fcf985e3c9bfd6944d07c4c36afbaee3384d040d | [
"Apache-2.0"
] | 89 | 2021-01-05T06:11:55.000Z | 2022-03-24T12:51:57.000Z | from optparse import OptionParser
class CmdParser(OptionParser):
def error(self, msg):
print('Error!提示信息如下:')
self.print_help()
self.exit(0)
def exit(self, status=0, msg=None):
exit(status)
| 19.416667 | 39 | 0.622318 | 210 | 0.850202 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 0.117409 |
081da69448bb7e8d65c5e3d690d670101f274a22 | 587 | py | Python | posts/migrations/0003_auto_20200522_0446.py | NotBlizzard/lark | b348f8d2b532ce20581030397cbba7f6565d1c56 | [
"MIT"
] | 2 | 2020-12-10T06:13:36.000Z | 2021-01-15T09:32:41.000Z | posts/migrations/0003_auto_20200522_0446.py | NotBlizzard/lark | b348f8d2b532ce20581030397cbba7f6565d1c56 | [
"MIT"
] | 7 | 2021-03-10T21:21:55.000Z | 2021-09-22T19:20:03.000Z | posts/migrations/0003_auto_20200522_0446.py | NotBlizzard/lark | b348f8d2b532ce20581030397cbba7f6565d1c56 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-22 04:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0002_auto_20200520_0536'),
]
operations = [
migrations.AddField(
model_name='post',
name='subtitle',
... | 23.48 | 63 | 0.574106 | 494 | 0.841567 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 0.195911 |
081ea6e893da219c4f8a085a91c4473a4ef03166 | 191 | py | Python | tasking/utils/models.py | cmanallen/tasking | 0a613357148afdb4b55078c58429ec45bb60a436 | [
"MIT"
] | null | null | null | tasking/utils/models.py | cmanallen/tasking | 0a613357148afdb4b55078c58429ec45bb60a436 | [
"MIT"
] | null | null | null | tasking/utils/models.py | cmanallen/tasking | 0a613357148afdb4b55078c58429ec45bb60a436 | [
"MIT"
] | null | null | null | from django.db import models
class TimeStamp(models.Model):
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
class Meta:
abstract = True | 21.222222 | 50 | 0.78534 | 160 | 0.837696 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
08212ae6445b938c3145af03c666f1c2c0d5163b | 439 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py | SirTelemak/cookiecutter-python-template | d7d8c4493250654a4ee3badb36c4c4da1ccb8d3d | [
"MIT"
] | 2 | 2020-06-04T19:17:13.000Z | 2020-06-05T08:05:16.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py | SirTelemak/cookiecutter-python-template | d7d8c4493250654a4ee3badb36c4c4da1ccb8d3d | [
"MIT"
] | 1 | 2020-08-06T15:01:47.000Z | 2020-08-06T15:01:47.000Z | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/conftest.py | SirTelemak/cookiecutter-python-template | d7d8c4493250654a4ee3badb36c4c4da1ccb8d3d | [
"MIT"
] | 2 | 2020-06-15T19:26:33.000Z | 2020-11-20T20:24:03.000Z | import logging
import pytest
from loguru import logger
@pytest.fixture(name='caplog', autouse=True)
def loguru_caplog(caplog):
class PropogateHandler(logging.Handler):
def emit(self, record):
logging.getLogger(record.name).handle(record)
logger.remove()
handler_id = logger.add(Prop... | 21.95 | 84 | 0.708428 | 131 | 0.298405 | 335 | 0.763098 | 380 | 0.865604 | 0 | 0 | 19 | 0.04328 |
08217e660e94837e28763173bb72fbc25fe9ee5e | 216 | py | Python | locale/pot/api/plotting/_autosummary/pyvista-Plotter-enable_lightkit-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 4 | 2020-08-07T08:19:19.000Z | 2020-12-04T09:51:11.000Z | locale/pot/api/plotting/_autosummary/pyvista-Plotter-enable_lightkit-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 19 | 2020-08-06T00:24:30.000Z | 2022-03-30T19:22:24.000Z | locale/pot/api/plotting/_autosummary/pyvista-Plotter-enable_lightkit-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 1 | 2021-03-09T07:50:40.000Z | 2021-03-09T07:50:40.000Z | # Create a plotter without any lights and then enable the
# default light kit.
#
import pyvista
pl = pyvista.Plotter(lighting=None)
pl.enable_lightkit()
actor = pl.add_mesh(pyvista.Cube(), show_edges=True)
pl.show()
| 24 | 57 | 0.763889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 78 | 0.361111 |
0822f1091f07394bee07ab3fa63b7142aa217e7c | 1,353 | py | Python | sphinx/environment/managers/__init__.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | null | null | null | sphinx/environment/managers/__init__.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | null | null | null | sphinx/environment/managers/__init__.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sphinx.environment.managers
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Manager components for sphinx.environment.
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
if False:
# For type annotation
from typing import An... | 26.529412 | 68 | 0.604582 | 921 | 0.68071 | 0 | 0 | 0 | 0 | 0 | 0 | 583 | 0.430894 |
0822f39156313d04e61ff6ddaaed66e14edc3a38 | 3,692 | py | Python | scripts/convert_queries.py | galuscakova/podcasts | 967cc04e2b0f7cf963a189ac5270cfa69f81a540 | [
"BSD-4-Clause-UC"
] | null | null | null | scripts/convert_queries.py | galuscakova/podcasts | 967cc04e2b0f7cf963a189ac5270cfa69f81a540 | [
"BSD-4-Clause-UC"
] | null | null | null | scripts/convert_queries.py | galuscakova/podcasts | 967cc04e2b0f7cf963a189ac5270cfa69f81a540 | [
"BSD-4-Clause-UC"
] | 1 | 2021-05-27T07:44:51.000Z | 2021-05-27T07:44:51.000Z | import getopt
import sys
import os
import re
import string
import xml.etree.ElementTree as ET
input_filename = ""
expansion_filename = ""
output_type = "combine"
exclude = set(string.punctuation)
options, remainder = getopt.getopt(sys.argv[1:], 'i:e:t:', ['inputfile=', 'expansionfile=', 'type='])
for opt, arg in op... | 34.830189 | 119 | 0.600488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 725 | 0.196371 |
08235f7faf3865296eebd91470431d320d7b228e | 370 | py | Python | createGlobalMap.py | abhi20sc/autoClim | b131a19e935e8ba7778a2c73107a183df37e92da | [
"MIT"
] | 2 | 2021-07-28T05:58:20.000Z | 2021-08-16T18:27:27.000Z | createGlobalMap.py | abhi20sc/autoClim | b131a19e935e8ba7778a2c73107a183df37e92da | [
"MIT"
] | null | null | null | createGlobalMap.py | abhi20sc/autoClim | b131a19e935e8ba7778a2c73107a183df37e92da | [
"MIT"
] | 3 | 2021-08-05T15:21:05.000Z | 2021-10-04T03:42:16.000Z | import cartopy.crs as ccrs
import cartopy.feature as cf
from matplotlib import pyplot as plt
from matplotlib import image as img
def createMap():
fig = plt.figure()
ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines(linewidth=1)
ax.add_feature(cf.BORDERS,linestyle='-',linewidth=1)
fig.savefig('globalMap.p... | 30.833333 | 64 | 0.767568 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 0.067568 |
0823b5eeb8c1036e06aae43d61945a3ec0226291 | 2,124 | py | Python | tests/decloud_unittest.py | CNES/decloud | 6b06ae98bfe68821b4ebd0e7ba06723809cb9b42 | [
"Apache-2.0"
] | 8 | 2022-02-25T13:15:07.000Z | 2022-03-20T18:29:49.000Z | tests/decloud_unittest.py | CNES/decloud | 6b06ae98bfe68821b4ebd0e7ba06723809cb9b42 | [
"Apache-2.0"
] | 1 | 2022-02-25T13:21:33.000Z | 2022-02-25T13:21:33.000Z | tests/decloud_unittest.py | CNES/decloud | 6b06ae98bfe68821b4ebd0e7ba06723809cb9b42 | [
"Apache-2.0"
] | 1 | 2022-03-31T23:43:12.000Z | 2022-03-31T23:43:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import subprocess
import unittest
import filecmp
import gdal
import otbApplication as otb
from abc import ABC
from decloud.core.system import get_env_var, pathify, basename
class DecloudTest(ABC, unittest.TestCase):
DECLOUD_DATA_DIR = get_env_var("DECLOUD_... | 38.618182 | 107 | 0.672787 | 1,891 | 0.890301 | 0 | 0 | 0 | 0 | 0 | 0 | 392 | 0.184557 |
08248ac0b1e2686f247d443d0208fc7018480282 | 1,327 | py | Python | test/test_merge.py | tawiesn/sclblonnx | 0cf73112db5df13009cd2ddb5d49744689096209 | [
"MIT"
] | null | null | null | test/test_merge.py | tawiesn/sclblonnx | 0cf73112db5df13009cd2ddb5d49744689096209 | [
"MIT"
] | null | null | null | test/test_merge.py | tawiesn/sclblonnx | 0cf73112db5df13009cd2ddb5d49744689096209 | [
"MIT"
] | null | null | null | from sclblonnx import add_output, add_input, add_node, node, empty_graph, add_constant, display, merge, run
import numpy as np
def test_merge():
# Subgraph 1
sg1 = empty_graph("Graph 1")
n1 = node('Add', inputs=['x1', 'x2'], outputs=['sum'])
sg1 = add_node(sg1, n1)
sg1 = add_input(sg1, 'x1', "FLO... | 34.025641 | 107 | 0.605124 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 394 | 0.29691 |
08248cc60a1189c226093e9c782fd70e1acdd43e | 2,609 | py | Python | src/cameraCalibrator.py | mdaros2016/CarND-Advanced-Lane-Lines | b27d57f1c6730f302f18fb6b8cbbfcb9361d57bf | [
"MIT"
] | null | null | null | src/cameraCalibrator.py | mdaros2016/CarND-Advanced-Lane-Lines | b27d57f1c6730f302f18fb6b8cbbfcb9361d57bf | [
"MIT"
] | null | null | null | src/cameraCalibrator.py | mdaros2016/CarND-Advanced-Lane-Lines | b27d57f1c6730f302f18fb6b8cbbfcb9361d57bf | [
"MIT"
] | null | null | null | import glob
import cv2
import numpy as np
class CameraCalibrator:
'''
Class for correcting the distortion of the pictures taken from the camera.
'''
def __init__(self, calibration_pictures_path_pattern='../camera_cal/calibration*.jpg'):
'''
:param calibration_pictures_path_pattern: F... | 38.367647 | 143 | 0.63166 | 2,563 | 0.982369 | 0 | 0 | 0 | 0 | 0 | 0 | 1,206 | 0.462246 |
0827c8ec658edf16eba00017e1a771b5d2f84def | 591 | py | Python | nicos_ess/dream/setups/beam_monitor.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_ess/dream/setups/beam_monitor.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_ess/dream/setups/beam_monitor.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'Instrument shutter'
prefix = "IOC"
devices = dict(
beam_monitor_1=device(
'nicos_ess.devices.epics.motor.EpicsMotor',
description="Beam monitor continuous position feedback",
motorpv=f'{prefix}:m8',
abslimits=(-10, 10),
unit='mm',
speed=5.,
),
... | 24.625 | 64 | 0.566836 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 225 | 0.380711 |