hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 4 247 | max_forks_repo_name stringlengths 4 130 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e7a4b5fb09634abd1ca90bf016b92845b12b05de | 9,803 | py | Python | dbservice/settings/base.py | aagaard/dbservice | 47daadab307e6744ef151dd4e0aacff27dcda881 | [
"MIT"
] | 1 | 2020-04-27T16:30:50.000Z | 2020-04-27T16:30:50.000Z | dbservice/settings/base.py | aagaard/dbservice | 47daadab307e6744ef151dd4e0aacff27dcda881 | [
"MIT"
] | null | null | null | dbservice/settings/base.py | aagaard/dbservice | 47daadab307e6744ef151dd4e0aacff27dcda881 | [
"MIT"
] | 1 | 2021-01-13T02:16:56.000Z | 2021-01-13T02:16:56.000Z | import os
import sys
from unipath import Path
import dbservice as project_module
"""Base settings shared by all environments"""
# =============================================================================
# Generic Django project settings
# =========================================================================... | 31.931596 | 99 | 0.504437 | import json
import os
import sys
from django.conf.global_settings import * # noqa
from django.core.exceptions import ImproperlyConfigured
from unipath import Path
import dbservice as project_module
"""Base settings shared by all environments"""
# ====================================================================... | 0 | 0 | 0 | 0 | 0 | 767 | 0 | 44 | 121 |
5fd11a23880c15d1d662e913d958ca72bd0a6c2f | 5,568 | py | Python | Chapter04/Activity4.02/Activity4.02_Unit_test.py | PacktWorkshops/Applied-Deep-Learning-with-Keras | d1372a6109e2ee9434ae47df59440577566badaa | [
"MIT"
] | 1 | 2021-02-16T13:28:41.000Z | 2021-02-16T13:28:41.000Z | Chapter04/Activity4.02/Activity4.02_Unit_test.py | olavomendes/The-Deep-Learning-with-Keras-Workshop | d1372a6109e2ee9434ae47df59440577566badaa | [
"MIT"
] | 6 | 2021-04-30T21:35:53.000Z | 2022-02-10T02:55:31.000Z | Chapter04/Activity4.02/Activity4.02_Unit_test.py | olavomendes/The-Deep-Learning-with-Keras-Workshop | d1372a6109e2ee9434ae47df59440577566badaa | [
"MIT"
] | 2 | 2020-01-03T10:22:19.000Z | 2020-01-13T06:30:33.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 40.642336 | 135 | 0.668463 | import unittest
import numpy as np
import pandas as pd
import numpy.testing as np_testing
import pandas.testing as pd_testing
import os
import import_ipynb
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense, Activation
from tensorflow import random
fr... | 0 | 0 | 0 | 3,930 | 0 | 1,004 | 0 | 190 | 378 |
71beae10da7209eb415ac2446f2c563e76e25076 | 3,832 | py | Python | templates/sentry.conf.py | jasonrogena/ansible-sentry | 7248a19f66109bcdb6a7c693ae0c781771894ffd | [
"MIT"
] | 1 | 2019-11-14T15:18:45.000Z | 2019-11-14T15:18:45.000Z | templates/sentry.conf.py | jasonrogena/ansible-sentry | 7248a19f66109bcdb6a7c693ae0c781771894ffd | [
"MIT"
] | 2 | 2019-09-27T08:49:39.000Z | 2021-03-23T17:09:13.000Z | templates/sentry.conf.py | jasonrogena/ansible-sentry | 7248a19f66109bcdb6a7c693ae0c781771894ffd | [
"MIT"
] | 3 | 2019-10-04T12:12:40.000Z | 2021-01-28T16:33:32.000Z | # This file is just Python, with a touch of Django which means
# you can inherit and tweak settings to your hearts content.
import os.path
CONF_ROOT = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'sentry.db.postgres',
'NAME': '{{ sentry_db_name }}',
'USER': '{{ sentry_db... | 27.177305 | 80 | 0.683455 | # This file is just Python, with a touch of Django which means
# you can inherit and tweak settings to your hearts content.
from sentry.conf.server import *
import os.path
CONF_ROOT = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'sentry.db.postgres',
'NAME': '{{ sentry_db_name }... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 22 |
1719680479b4b558551123effe8d23c6a8b5ce10 | 3,402 | py | Python | markov.py | mbichoffe/markov_chains_twitter | 1a206e20061ec71505e4a28f1a2a96d999d99a2e | [
"MIT",
"Unlicense"
] | null | null | null | markov.py | mbichoffe/markov_chains_twitter | 1a206e20061ec71505e4a28f1a2a96d999d99a2e | [
"MIT",
"Unlicense"
] | 1 | 2021-02-08T20:21:10.000Z | 2021-02-08T20:21:10.000Z | markov.py | mbichoffe/markov_chains_twitter | 1a206e20061ec71505e4a28f1a2a96d999d99a2e | [
"MIT",
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == "__main__":
main()
| 29.842105 | 84 | 0.574956 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import sys
from text_stoppers import *
from text_validators import *
from random import choice
class MarkovGenerator(object):
"""A Markov chain text generator"""
def open_and_read_file(self, filename):
"""Take file(s) as tuples; return text ... | 0 | 0 | 0 | 2,854 | 0 | 305 | 0 | -1 | 156 |
cde00c76f75eb8efb107ab70115d81a15e0bb8b3 | 3,238 | py | Python | tor_ocr/core/config.py | GrafeasGroup/tor_ocr | e20631ab69a7977d6f470112ff719833f80d0f58 | [
"MIT"
] | 9 | 2017-11-25T15:18:12.000Z | 2022-01-04T09:49:20.000Z | tor_ocr/core/config.py | GrafeasGroup/tor_ocr | e20631ab69a7977d6f470112ff719833f80d0f58 | [
"MIT"
] | 22 | 2018-01-16T11:31:20.000Z | 2022-03-15T12:19:13.000Z | tor_ocr/core/config.py | GrafeasGroup/tor_ocr | e20631ab69a7977d6f470112ff719833f80d0f58 | [
"MIT"
] | 4 | 2017-12-01T13:39:14.000Z | 2022-02-04T23:45:03.000Z | import os
# Load configuration regardless of if bugsnag is setup correctly
try:
import bugsnag
except ImportError:
# If loading from setup.py or bugsnag isn't installed, we
# don't want to bomb out completely
bugsnag = None
import pkg_resources
_missing = object()
# @see https://stackoverflow.com/a... | 29.706422 | 83 | 0.675108 | from typing import Any, Callable, Dict
import datetime
import os
from blossom_wrapper import BlossomAPI
from praw import Reddit
# Load configuration regardless of if bugsnag is setup correctly
try:
import bugsnag
except ImportError:
# If loading from setup.py or bugsnag isn't installed, we
# don't want to... | 0 | 165 | 0 | 2,184 | 0 | 0 | 0 | 30 | 134 |
d97c3c948b0111a84042fd8c4b136d61148ac89c | 1,260 | py | Python | setup.py | tpyo/pipsy | 2b9abaa5e53f12421f6e890380552551f582b5dc | [
"MIT"
] | null | null | null | setup.py | tpyo/pipsy | 2b9abaa5e53f12421f6e890380552551f582b5dc | [
"MIT"
] | null | null | null | setup.py | tpyo/pipsy | 2b9abaa5e53f12421f6e890380552551f582b5dc | [
"MIT"
] | 1 | 2019-12-12T15:26:31.000Z | 2019-12-12T15:26:31.000Z | # -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='pipsy',
version="0.1.2",
description='Shows updates for installed packages',
long_description='Shows available updates and security notices for installed packages',
author='Donovan Schnknecht',
author_email='don@tpyo.net',
u... | 30 | 91 | 0.585714 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='pipsy',
version="0.1.2",
description='Shows updates for installed packages',
long_description='Shows available updates and security notices for installed packages',
author='Donovan Schönknecht',
author_email='don@... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
811a5527f91208edd02db398831978cdf699e4ae | 3,167 | py | Python | machine_learner/machine_learner/models/plLaRegression.py | FedericoQuin/2dv50e | 4db80de187776ca2303bf14a233057447e6f94f1 | [
"MIT"
] | null | null | null | machine_learner/machine_learner/models/plLaRegression.py | FedericoQuin/2dv50e | 4db80de187776ca2303bf14a233057447e6f94f1 | [
"MIT"
] | null | null | null | machine_learner/machine_learner/models/plLaRegression.py | FedericoQuin/2dv50e | 4db80de187776ca2303bf14a233057447e6f94f1 | [
"MIT"
] | 3 | 2019-03-03T16:48:21.000Z | 2021-11-18T09:35:47.000Z | import os
DIR_PATH = os.path.join('machine_learner', 'trained_models', 'pllaregression')
| 36.825581 | 117 | 0.668772 | import traceback
import os
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.linear_model import SGDRegressor
from machine_learner.utils import repository
DIR_PATH = os.path.join('machine_learner', 'trained_models', 'pllaregression')
def training(features, target_pl, target_la, cycle):
... | 0 | 0 | 0 | 0 | 0 | 2,851 | 0 | 64 | 156 |
08f19e444351c614538acac185696342a390748d | 3,676 | py | Python | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | null | null | null | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | 1 | 2021-03-20T00:32:17.000Z | 2021-03-20T00:32:17.000Z | migrations/versions/143f81c3bba3_submission_table.py | nycrecords/GPP | 7b7d1a26f6b1cbde051a0a0642407f9aa36e5b2e | [
"Apache-2.0"
] | null | null | null | """submission table
Revision ID: 143f81c3bba3
Revises:
Create Date: 2019-02-25 21:25:17.891423
"""
# revision identifiers, used by Alembic.
revision = '143f81c3bba3'
down_revision = None
branch_labels = None
depends_on = None
| 81.688889 | 929 | 0.726333 | """submission table
Revision ID: 143f81c3bba3
Revises:
Create Date: 2019-02-25 21:25:17.891423
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '143f81c3bba3'
down_revision = None
branch_labels = None
depends_on = None
... | 0 | 0 | 0 | 0 | 0 | 3,308 | 0 | 24 | 112 |
7c64a6b1ab3058e8ebef0ebd3cd11fb5ea4faca3 | 2,614 | py | Python | mongodb-practice/user_activity_db.py | amgad01/nosql-practice | cb188c4a615aa92d0f2022e2bfd84591474f5c38 | [
"MIT"
] | null | null | null | mongodb-practice/user_activity_db.py | amgad01/nosql-practice | cb188c4a615aa92d0f2022e2bfd84591474f5c38 | [
"MIT"
] | null | null | null | mongodb-practice/user_activity_db.py | amgad01/nosql-practice | cb188c4a615aa92d0f2022e2bfd84591474f5c38 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
import os
USERNAME = os.environ.get('USERNAME')
PASSWORD = os.environ.get('PASSWORD')
CLUSTER_INFO = os.environ.get('CLUSTER_INFO')
DB_NAME = os.environ.get('DB_NAME')
COLLECTION_NAME = os.environ.get('COLLECTION_NAME')
cluster = MongoClient(f'mongodb+srv://{USERNAME}:{PASSWORD}{CLUSTER... | 31.119048 | 89 | 0.686687 | from pymongo import MongoClient
import os
USERNAME = os.environ.get('USERNAME')
PASSWORD = os.environ.get('PASSWORD')
CLUSTER_INFO = os.environ.get('CLUSTER_INFO')
DB_NAME = os.environ.get('DB_NAME')
COLLECTION_NAME = os.environ.get('COLLECTION_NAME')
cluster = MongoClient(f'mongodb+srv://{USERNAME}:{PASSWORD}{CLUSTER... | 0 | 0 | 0 | 0 | 0 | 94 | 0 | 0 | 22 |
40980b6b967b533d1cc5c012af6e07cf8d2c9df3 | 519 | py | Python | python3.4Smartforest/lib/python3.4/site-packages/django/utils/duration.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | python3.4Smartforest/lib/python3.4/site-packages/django/utils/duration.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | python3.4Smartforest/lib/python3.4/site-packages/django/utils/duration.py | letouriste001/SmartForest_2.0 | 109b78bf1e8c8404800f377ab969395ccbb617be | [
"MIT"
] | null | null | null | """Version of str(timedelta) which is not English specific."""
def duration_string(duration):
days = duration.days
seconds = duration.seconds
microseconds = duration.microseconds
minutes = seconds // 60
seconds = seconds % 60
hours = minutes // 60
minutes = minutes % 60
string = '{:... | 519 | 519 | 0.626204 | """Version of str(timedelta) which is not English specific."""
def duration_string(duration):
days = duration.days
seconds = duration.seconds
microseconds = duration.microseconds
minutes = seconds // 60
seconds = seconds % 60
hours = minutes // 60
minutes = minutes % 60
string = '{:... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fc87b40add6ed0b9a6c53461503078e30928e2cd | 8,957 | py | Python | dit/pid/measures/idep.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | 1 | 2020-03-13T10:30:11.000Z | 2020-03-13T10:30:11.000Z | dit/pid/measures/idep.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | null | null | null | dit/pid/measures/idep.py | Ejjaffe/dit | c9d206f03d1de5a0a298b1d0ea9d79ea5e789ee1 | [
"BSD-3-Clause"
] | null | null | null | """
The dependency-decomposition based unique measure partial information decomposition.
"""
__all__ = (
'PID_dep',
'PID_RA',
)
| 35.12549 | 98 | 0.592609 | """
The dependency-decomposition based unique measure partial information decomposition.
"""
from ...multivariate import coinformation
from ..pid import BaseUniquePID
from ...profiles import DependencyDecomposition
__all__ = (
'PID_dep',
'PID_RA',
)
class PID_dep(BaseUniquePID):
"""
The dependency ... | 0 | 7,514 | 0 | 1,062 | 0 | 0 | 0 | 56 | 182 |
ce9cd9ea62d77873530a9f44bd71aefdee85fa49 | 967 | py | Python | setup.py | dcdanko/capalyzer | 45f0283109542aaaecc5d28e800b819a0be62726 | [
"MIT"
] | 1 | 2019-11-22T16:37:34.000Z | 2019-11-22T16:37:34.000Z | setup.py | dcdanko/capalyzer | 45f0283109542aaaecc5d28e800b819a0be62726 | [
"MIT"
] | 9 | 2018-05-24T20:47:26.000Z | 2019-07-02T21:30:54.000Z | setup.py | dcdanko/capalyzer | 45f0283109542aaaecc5d28e800b819a0be62726 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
setuptools
setuptools.setup(
name='capalyzer',
version='2.16.0',
description="Parsing functionality for the metasub CAP",
author="David C. Danko",
author_email='dcdanko@gmail.com',
url='https://github.com/dcdanko/capalyzer',
p... | 24.794872 | 60 | 0.584281 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
setuptools
setuptools.setup(
name='capalyzer',
version='2.16.0',
description="Parsing functionality for the metasub CAP",
author="David C. Danko",
author_email='dcdanko@gmail.com',
url='https://github.com/dcdanko/capalyzer',
p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c525f1062309bd1fe185d1192e1da1b6b6556d8d | 1,180 | py | Python | terrain/config.py | cisaacstern/terrain-corrector | 6c82babb5ace3306d741760fb14db47b3ef0a7b8 | [
"Apache-2.0"
] | null | null | null | terrain/config.py | cisaacstern/terrain-corrector | 6c82babb5ace3306d741760fb14db47b3ef0a7b8 | [
"Apache-2.0"
] | null | null | null | terrain/config.py | cisaacstern/terrain-corrector | 6c82babb5ace3306d741760fb14db47b3ef0a7b8 | [
"Apache-2.0"
] | null | null | null | import toml
import os
import datetime
#load config.toml
cwd = os.getcwd()
path = os.path.join(cwd,'terrain-corrector','terrain','settings','config.toml')
config = toml.load(path)
#add config to locals
locals().update(config)
#...and a few more expressive variations
BOUNDS = [*EAST_BOUNDS, *NORTH_BOUNDS, *ELEV_BOUNDS]
... | 36.875 | 79 | 0.734746 | import toml
import os
import datetime
import itertools
#load config.toml
cwd = os.getcwd()
path = os.path.join(cwd,'terrain-corrector','terrain','settings','config.toml')
config = toml.load(path)
#add config to locals
locals().update(config)
#...and a few more expressive variations
BOUNDS = [*EAST_BOUNDS, *NORTH_BOUND... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 22 |
5329905446ed059c91fefa7dd21cbee32116b9ff | 1,992 | py | Python | pycozmo/CozmoAnim/BodyMotion.py | gimait/pycozmo | 601d9c09903b9300e8990723cae95974212afb09 | [
"MIT"
] | 123 | 2019-08-25T21:28:23.000Z | 2022-03-12T13:54:59.000Z | pycozmo/CozmoAnim/BodyMotion.py | solosito/pycozmo | 5d28118eb8f7a625ae4a66054dabf19b4fe27483 | [
"MIT"
] | 41 | 2019-08-25T21:21:37.000Z | 2022-02-09T14:20:54.000Z | pycozmo/CozmoAnim/BodyMotion.py | solosito/pycozmo | 5d28118eb8f7a625ae4a66054dabf19b4fe27483 | [
"MIT"
] | 51 | 2019-09-04T13:30:02.000Z | 2022-01-09T01:20:24.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: CozmoAnim
| 36.218182 | 145 | 0.697289 | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: CozmoAnim
import flatbuffers
class BodyMotion(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsBodyMotion(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Bo... | 0 | 188 | 0 | 1,126 | 0 | 409 | 0 | -3 | 179 |
9fb83f694c47b019db04efa9f0f92de9216748d1 | 33,041 | py | Python | src/vesper/app.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | src/vesper/app.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | src/vesper/app.py | onecommons/vesper | 818c09350b8fe53ea484aaff24deb1002a67f471 | [
"Apache-2.0"
] | null | null | null | #:copyright: Copyright 2009-2010 by the Vesper team, see AUTHORS.
#:license: Dual licenced under the GPL or Apache2 licences, see LICENSE.
"""
vesper.app
==========
This module defines the framework used by Vesper to bootstrap a running server from
a given configuration.
"""
import os, os.path, sys
imp... | 40.244823 | 106 | 0.593293 | #:copyright: Copyright 2009-2010 by the Vesper team, see AUTHORS.
#:license: Dual licenced under the GPL or Apache2 licences, see LICENSE.
"""
vesper.app
==========
This module defines the framework used by Vesper to bootstrap a running server from
a given configuration.
"""
import os, os.path, sys, tr... | 0 | 528 | 0 | 21,610 | 0 | 1,909 | 0 | 145 | 498 |
bcd6579d525079638df83054d35c397e48a72c3d | 735 | py | Python | DataMining/Demo_1/step_10_dec_dimension.py | AlexYu-beta/Python_Study | 6d90b605e47d9341b20a41e7384be269243b14ba | [
"Unlicense"
] | null | null | null | DataMining/Demo_1/step_10_dec_dimension.py | AlexYu-beta/Python_Study | 6d90b605e47d9341b20a41e7384be269243b14ba | [
"Unlicense"
] | null | null | null | DataMining/Demo_1/step_10_dec_dimension.py | AlexYu-beta/Python_Study | 6d90b605e47d9341b20a41e7384be269243b14ba | [
"Unlicense"
] | null | null | null | from step_02_data_analyzer import data, target
from step_05_classify_data import t
from sklearn.decomposition import PCA
from pylab import plot, show, figure, subplot
pca = PCA(n_components=2)
pcad = pca.fit_transform(data)
figure()
subplot(211)
plot(pcad[target=='setosa',0],pcad[target=='setosa',1],'bo')
plot(pcad... | 27.222222 | 68 | 0.730612 | from step_02_data_analyzer import data, target
from step_05_classify_data import t
from sklearn.decomposition import PCA
from pylab import plot, show, figure, subplot
pca = PCA(n_components=2)
pcad = pca.fit_transform(data)
figure()
subplot(211)
plot(pcad[target=='setosa',0],pcad[target=='setosa',1],'bo')
plot(pcad... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
304600ad47ed3e4d99b4c1352f494e355e985269 | 22,113 | py | Python | notifier/access.py | slideinc/notifier | 7d370cc910d0133eaae50da24496948a353fa666 | [
"BSD-3-Clause"
] | 1 | 2016-09-23T07:22:46.000Z | 2016-09-23T07:22:46.000Z | notifier/access.py | slideinc/notifier | 7d370cc910d0133eaae50da24496948a353fa666 | [
"BSD-3-Clause"
] | null | null | null | notifier/access.py | slideinc/notifier | 7d370cc910d0133eaae50da24496948a353fa666 | [
"BSD-3-Clause"
] | null | null | null | # -*- Mode: Python; tab-width: 4 -*-
# Copyright (c) 2005-2010 Slide, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrig... | 30.458678 | 90 | 0.608149 | # -*- Mode: Python; tab-width: 4 -*-
# Copyright (c) 2005-2010 Slide, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrig... | 0 | 7,032 | 0 | 3,471 | 0 | 4,104 | 0 | 0 | 519 |
77c23b75bb2085f24c3aae732cc4256d128367c4 | 968 | py | Python | python/search/find_k.py | rgabeflores/Structures-Functions-Algorithms | fe93372db16eff81a0c4502f0c6d7319fc5b3841 | [
"MIT"
] | 1 | 2019-12-05T06:49:34.000Z | 2019-12-05T06:49:34.000Z | python/search/find_k.py | rgabeflores/Data-Structures-and-Algorithms | fe93372db16eff81a0c4502f0c6d7319fc5b3841 | [
"MIT"
] | null | null | null | python/search/find_k.py | rgabeflores/Data-Structures-and-Algorithms | fe93372db16eff81a0c4502f0c6d7319fc5b3841 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
main() | 18.264151 | 71 | 0.603306 | import random as r
def find_k(a,key):
pivot = get_pivot(a)
left = list()
right = list()
for x in a:
if x <= pivot:
left.append(x)
else:
right.append(x)
length = len(left)
if(length > key):
return find_k(left,key)
elif(length == key):
return pivot
else:
return find_k(right, (key - (len(left))... | 0 | 0 | 0 | 0 | 0 | 845 | 0 | -3 | 91 |
675b1020da5a77b7b649dc1568b5d103f6d1849f | 2,020 | py | Python | day01_03/day02/5_post_youdao_translate.py | xiangzaizi/base_spider | fa548f43e1f92016e710f9ffeb912e61eb690433 | [
"MIT"
] | null | null | null | day01_03/day02/5_post_youdao_translate.py | xiangzaizi/base_spider | fa548f43e1f92016e710f9ffeb912e61eb690433 | [
"MIT"
] | null | null | null | day01_03/day02/5_post_youdao_translate.py | xiangzaizi/base_spider | fa548f43e1f92016e710f9ffeb912e61eb690433 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import json
if __name__ == '__main__':
html = send_request()
dict_obj = json.loads(html)
#
print(dict_obj["translateResult"][0][0]["tgt"])
| 32.580645 | 241 | 0.612871 | # -*- coding:utf-8 -*-
import json
import time
import random
import hashlib
import urllib
import urllib2
def send_request():
# js解密算法数据
r = str(int(time.time() * 1000) + random.randint(0, 10))
D = "ebSeFb%=XZ%T[KZ)c(sy!"
S = "fanyideskweb"
n = raw_input("请输入需要翻译的文字:")
sign = hashlib.md5(r + D +... | 63 | 0 | 0 | 0 | 0 | 1,724 | 0 | -40 | 133 |
ae287f1bbd7cb8cd3d571bb67523ab57d8016931 | 5,647 | py | Python | run_game_dirichlet.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | run_game_dirichlet.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | run_game_dirichlet.py | tzmhuang/chess-nn | ecd2188063155544dc7759e72602df9a8bcf76c1 | [
"MIT"
] | null | null | null | from Desktop.chess-nn.evl_conv_3 import model_fn
with tf.device('/gpu:0'):
evl_conv_temp = tf.estimator.Estimator(
model_fn = model_fn, model_dir = './DNN/evl_conv_5')
player_side = input("Please choose your side(b/w): ")
difficulty = input("Choose Difficulty(1-10): ")
board = chess.Board()
#done? ... | 31.027473 | 102 | 0.561183 | from Desktop.chess-nn.minimax_lookup import *
from Desktop.chess-nn.evl_conv_3 import model_fn
def predict_input_fn(data):
data = data.astype('float32')
tmp = {'x':data}
return tf.estimator.inputs.numpy_input_fn(x = tmp,num_epochs = 1, shuffle = False )
with tf.device('/gpu:0'):
evl_conv_temp = tf... | 0 | 0 | 0 | 0 | 0 | 4,853 | 0 | 24 | 248 |
e1bd0b4f7e3fdaf1db8c14492ba9eb4962748dc8 | 337 | py | Python | contracts/business_template/privacy_computation/Fiat-Shamir-ZK/contract_step45.py | fengqiao/SmartDev-Contract | f2a7eec1dfd1b6dba7ae5c3ddc9b04e27517d8aa | [
"Apache-2.0"
] | 2 | 2021-12-01T06:47:30.000Z | 2021-12-07T06:19:37.000Z | contracts/business_template/privacy_computation/Fiat-Shamir-ZK/contract_step45.py | fengqiao/SmartDev-Contract | f2a7eec1dfd1b6dba7ae5c3ddc9b04e27517d8aa | [
"Apache-2.0"
] | 2 | 2021-08-12T08:19:12.000Z | 2021-08-18T10:54:37.000Z | contracts/business_template/privacy_computation/Fiat-Shamir-ZK/contract_step45.py | fengqiao/SmartDev-Contract | f2a7eec1dfd1b6dba7ae5c3ddc9b04e27517d8aa | [
"Apache-2.0"
] | 2 | 2020-09-07T11:03:01.000Z | 2020-10-03T14:42:20.000Z | import hashlib
n=8269
g=11
password = "Hello"
x = int(hashlib.sha256(password.encode()).hexdigest()[:8], 16) % n
print('\n======Phase 4: Peggy recieves c and calculate r=v-cx, sends r to Victor==================')
c = input("c= ")
v = input("v= ")
r = (int(v) - int(c) * x) % (n-1)
print('r=v-cx =\t\t',r) | 21.0625 | 100 | 0.581602 | import libnum
import hashlib
import random
n=8269
g=11
password = "Hello"
x = int(hashlib.sha256(password.encode()).hexdigest()[:8], 16) % n
print('\n======Phase 4: Peggy recieves c and calculate r=v-cx, sends r to Victor==================')
c = input("c= ")
v = input("v= ")
r = (int(v) - int(c) * x) % (n-1)
print(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -16 | 44 |
2522d9abf7f4fcc6d398258759e255fc064f6901 | 15,340 | py | Python | verification/tests.py | cielavenir/checkio-task-painting-wall | 3502ac1d9f795b4e5c8fa46739e9fa438d16e026 | [
"MIT"
] | null | null | null | verification/tests.py | cielavenir/checkio-task-painting-wall | 3502ac1d9f795b4e5c8fa46739e9fa438d16e026 | [
"MIT"
] | 1 | 2017-06-21T18:00:21.000Z | 2017-06-21T18:00:21.000Z | verification/tests.py | CheckIO-to-German/Painting-Wall | 737e07e1b3b2176ea3fa999b916c30992b397506 | [
"MIT"
] | 1 | 2017-06-21T17:57:21.000Z | 2017-06-21T17:57:21.000Z | #TESTS is a dict with all you tests.
#Keys for this will be categories' names.
#Each test is dict with
# "input" -- input data for user function
# "answer" -- your right answer
# "explanation" -- not necessary key, it's using for additional info in animation.
TESTS = {
"1. Small By Hand 1 (Example)": [
{
... | 59.688716 | 119 | 0.469296 | #TESTS is a dict with all you tests.
#Keys for this will be categories' names.
#Each test is dict with
# "input" -- input data for user function
# "answer" -- your right answer
# "explanation" -- not necessary key, it's using for additional info in animation.
TESTS = {
"1. Small By Hand 1 (Example)": [
{
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fb0a633bd86c4a2b25ef3b54465361faff3666bb | 1,749 | py | Python | homepage/migrations/0001_initial.py | chadrick-kwag/labeldat.a | 02a5fe06ee244ae5e724336a8ae3c9c28a76b115 | [
"Apache-2.0"
] | null | null | null | homepage/migrations/0001_initial.py | chadrick-kwag/labeldat.a | 02a5fe06ee244ae5e724336a8ae3c9c28a76b115 | [
"Apache-2.0"
] | null | null | null | homepage/migrations/0001_initial.py | chadrick-kwag/labeldat.a | 02a5fe06ee244ae5e724336a8ae3c9c28a76b115 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0 on 2018-02-24 15:05
| 38.866667 | 115 | 0.578045 | # Generated by Django 2.0 on 2018-02-24 15:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Dataset',
fields=[
... | 0 | 0 | 0 | 1,604 | 0 | 0 | 0 | 30 | 68 |
8cc5128fa7df88fc6132133d988d02139b2ec674 | 150 | py | Python | kekette/__init__.py | prashnts/kekette | 6f39107b8fe3a53f16334e1dd51612e13ec03241 | [
"MIT"
] | null | null | null | kekette/__init__.py | prashnts/kekette | 6f39107b8fe3a53f16334e1dd51612e13ec03241 | [
"MIT"
] | null | null | null | kekette/__init__.py | prashnts/kekette | 6f39107b8fe3a53f16334e1dd51612e13ec03241 | [
"MIT"
] | null | null | null | from .attrdict import AttrDict
from .magic import mproperty, magic_tuple
__version__ = (0, 1, 0)
__all__ = ('AttrDict', 'mproperty', 'magic_tuple')
| 21.428571 | 50 | 0.733333 | from .attrdict import AttrDict
from .magic import mproperty, magic_tuple
__version__ = (0, 1, 0)
__all__ = ('AttrDict', 'mproperty', 'magic_tuple')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
99aa8acb8fad1fff2e2d1e7bfd8b5d2514c352c9 | 4,104 | py | Python | pysnmp/CISCO-WAN-ATM-CONN-STAT-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-WAN-ATM-CONN-STAT-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-WAN-ATM-CONN-STAT-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-WAN-ATM-CONN-STAT-CAPABILITY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WAN-ATM-CONN-STAT-CAPABILITY
# Produced by pysmi-0.3.4 at Mon Apr 29 18:03:46 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using... | 102.6 | 477 | 0.78655 | #
# PySNMP MIB module CISCO-WAN-ATM-CONN-STAT-CAPABILITY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WAN-ATM-CONN-STAT-CAPABILITY
# Produced by pysmi-0.3.4 at Mon Apr 29 18:03:46 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
227f2116d1f99396958e9d7fe6b189375da9b28e | 117,740 | py | Python | Processor.py | mdorobek/authorship_analysis | 34221a56da229e5113b6d7bb2fb125cd50deb077 | [
"Unlicense"
] | null | null | null | Processor.py | mdorobek/authorship_analysis | 34221a56da229e5113b6d7bb2fb125cd50deb077 | [
"Unlicense"
] | null | null | null | Processor.py | mdorobek/authorship_analysis | 34221a56da229e5113b6d7bb2fb125cd50deb077 | [
"Unlicense"
] | null | null | null | import pandas as pd
# Chapter 7.1.1. method to trim a feature with low sum e.g. ngrams lower then 5
# Chapter 7.1.1. method to trim feature with low occurrence over all article
# Chapter 7.1.1. Process of filtering the data with low occurrence and save the filtered features in a new file
# Chapter 7... | 56.524244 | 125 | 0.630109 | import pandas as pd
import numpy as np
import copy
from sklearn.naive_bayes import GaussianNB
from sklearn.model_selection import cross_val_score, train_test_split, GridSearchCV
from sklearn.feature_selection import mutual_info_classif, SelectKBest
import matplotlib.pyplot as plt
from sklearn import svm
from sk... | 14 | 0 | 0 | 0 | 0 | 107,799 | 0 | 702 | 1,382 |
c7698d4ce5cfa89219ea4a5af69575fe9fa793f4 | 1,386 | py | Python | climate_toolbox/io/io.py | ClimateImpactLab/climate_toolbox | 9cd3e952213ef938c5cdd6b0805ace06134fcedc | [
"MIT"
] | 2 | 2017-07-19T19:12:41.000Z | 2020-05-03T20:41:36.000Z | climate_toolbox/io/io.py | ClimateImpactLab/climate_toolbox | 9cd3e952213ef938c5cdd6b0805ace06134fcedc | [
"MIT"
] | 19 | 2017-07-25T01:09:19.000Z | 2021-11-15T17:47:36.000Z | climate_toolbox/io/io.py | ClimateImpactLab/climate_toolbox | 9cd3e952213ef938c5cdd6b0805ace06134fcedc | [
"MIT"
] | 2 | 2019-05-23T17:13:39.000Z | 2019-06-11T22:07:39.000Z | import xarray as xr
def standardize_climate_data(ds):
"""
Read climate data and standardize units to:
- lon and lat,
- lon to -180 to 180 and
Parameters
----------
ds: xr.Dataset
Returns
-------
xr.Dataset
"""
ds = rename_coords_to_lon_and_lat(ds)
ds = c... | 19.25 | 71 | 0.609668 | import xarray as xr
from climate_toolbox.utils.utils import *
def standardize_climate_data(ds):
"""
Read climate data and standardize units to:
- lon and lat,
- lon to -180 to 180 and
Parameters
----------
ds: xr.Dataset
Returns
-------
xr.Dataset
"""
ds = ... | 0 | 0 | 0 | 0 | 0 | 114 | 0 | 20 | 69 |
427234c66c82320c22f22997132ac12163d9ee78 | 233 | py | Python | images/hub/canvasauthenticator/setup.py | STAT-89A/datahub | 2e257a2921a1d771f1bdaae0ab91fb15809e1964 | [
"BSD-3-Clause"
] | 1 | 2020-03-12T21:11:41.000Z | 2020-03-12T21:11:41.000Z | images/hub/canvasauthenticator/setup.py | STAT-89A/datahub | 2e257a2921a1d771f1bdaae0ab91fb15809e1964 | [
"BSD-3-Clause"
] | 7 | 2021-06-08T21:58:22.000Z | 2022-03-12T00:39:12.000Z | images/hub/canvasauthenticator/setup.py | STAT-89A/datahub | 2e257a2921a1d771f1bdaae0ab91fb15809e1964 | [
"BSD-3-Clause"
] | 1 | 2020-05-11T22:26:41.000Z | 2020-05-11T22:26:41.000Z | from setuptools import setup, find_packages
setup(
name='jupyterhub-canvasauthenticator',
version='0.1dev',
python_requires='>=3.5',
packages=find_packages(),
install_requires=[
'oauthenticator',
]
)
| 19.416667 | 43 | 0.669528 | from setuptools import setup, find_packages
setup(
name='jupyterhub-canvasauthenticator',
version='0.1dev',
python_requires='>=3.5',
packages=find_packages(),
install_requires=[
'oauthenticator',
]
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
53f8378d85207c764dfcae0953e3dee99ff4139d | 458 | py | Python | code/tests/unit/api/utils.py | CiscoSecurity/tr-05-serverless-gigamon-threatinsight | 2a4edf83037f9a5f2743aa9c0de6e09b2d4e6b9c | [
"MIT"
] | 2 | 2020-07-29T07:46:40.000Z | 2020-10-08T20:02:02.000Z | code/tests/unit/api/utils.py | CiscoSecurity/tr-05-serverless-gigamon-threatinsight | 2a4edf83037f9a5f2743aa9c0de6e09b2d4e6b9c | [
"MIT"
] | 6 | 2020-07-28T06:21:48.000Z | 2021-11-30T09:47:53.000Z | code/tests/unit/api/utils.py | CiscoSecurity/tr-05-gigamon-threatinsight | aeaa0bee55d2cdc8badf4c9ea0e830822acab24e | [
"MIT"
] | 1 | 2021-02-24T08:59:24.000Z | 2021-02-24T08:59:24.000Z | import json
import os
def load_fixture(path):
"""Load a JSON fixture given a relative path to it."""
if not path.endswith('.json'):
path += '.json'
# Build the absolute path to the fixture.
path = os.path.join(
os.path.dirname(__file__),
'fixtures',
path,
)
... | 19.083333 | 58 | 0.591703 | import json
import os
def headers(jwt, type_='Bearer'):
return {'Authorization': f'{type_} {jwt}'}
def load_fixture(path):
"""Load a JSON fixture given a relative path to it."""
if not path.endswith('.json'):
path += '.json'
# Build the absolute path to the fixture.
path = os.path.join... | 0 | 0 | 0 | 0 | 0 | 59 | 0 | 0 | 23 |
7c2317edf72efe98a4f8a8b8871fb51dae9105d2 | 1,849 | py | Python | postgresqleu/elections/migrations/0001_initial.py | bradfordboyle/pgeu-system | bbe70e7a94092c10f11a0f74fda23079532bb018 | [
"MIT"
] | 11 | 2020-08-20T11:16:02.000Z | 2022-03-12T23:25:04.000Z | postgresqleu/elections/migrations/0001_initial.py | bradfordboyle/pgeu-system | bbe70e7a94092c10f11a0f74fda23079532bb018 | [
"MIT"
] | 71 | 2019-11-18T10:11:22.000Z | 2022-03-27T16:12:57.000Z | postgresqleu/elections/migrations/0001_initial.py | bradfordboyle/pgeu-system | bbe70e7a94092c10f11a0f74fda23079532bb018 | [
"MIT"
] | 18 | 2019-11-18T09:56:31.000Z | 2022-01-08T03:16:43.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 38.520833 | 114 | 0.561385 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from postgresqleu.util.fields import LowercaseEmailField
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Candidate',
... | 0 | 0 | 0 | 1,662 | 0 | 0 | 0 | 54 | 68 |
7742e3f9b237f450a1868332795a43142a5b4576 | 4,745 | py | Python | tests/munki/test_munki_install_probe.py | arubdesu/zentral | ac0fe663f6e1c27f9a9f55a7500a87e6ac7d9190 | [
"Apache-2.0"
] | 634 | 2015-10-30T00:55:40.000Z | 2022-03-31T02:59:00.000Z | tests/munki/test_munki_install_probe.py | arubdesu/zentral | ac0fe663f6e1c27f9a9f55a7500a87e6ac7d9190 | [
"Apache-2.0"
] | 145 | 2015-11-06T00:17:33.000Z | 2022-03-16T13:30:31.000Z | tests/munki/test_munki_install_probe.py | arubdesu/zentral | ac0fe663f6e1c27f9a9f55a7500a87e6ac7d9190 | [
"Apache-2.0"
] | 103 | 2015-11-07T07:08:49.000Z | 2022-03-18T17:34:36.000Z |
payload_template = {
"unattended": True,
"run_type": "auto",
"status": 0,
"duration_seconds": 16,
"basename": "ManagedInstallReport.plist",
"type": "install",
"applesus": False,
"munki_version": "2.8.0.2810",
"version": "50.0",
"display_name": "Mozilla Firefox",
"sha1sum": ... | 41.26087 | 116 | 0.624447 | from django.test import TestCase
from zentral.core.events import event_types
from zentral.core.events.base import EventMetadata
from zentral.core.probes.base import PayloadFilter
from zentral.core.probes.models import ProbeSource
from tests.inventory.utils import MockMetaMachine
payload_template = {
"unattended":... | 0 | 0 | 0 | 3,407 | 0 | 607 | 0 | 148 | 178 |
0e87d1c175bfbb6220bba4dd601eb79b60c2ba41 | 1,476 | py | Python | prj/setup_complex.py | asvetlov/optimization-kiev-2017 | 760c7af223d4c993beb367a15687f7dc99313431 | [
"Apache-2.0"
] | null | null | null | prj/setup_complex.py | asvetlov/optimization-kiev-2017 | 760c7af223d4c993beb367a15687f7dc99313431 | [
"Apache-2.0"
] | null | null | null | prj/setup_complex.py | asvetlov/optimization-kiev-2017 | 760c7af223d4c993beb367a15687f7dc99313431 | [
"Apache-2.0"
] | null | null | null |
from setuptools import Extension, setup
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
ext = '.pyx' if USE_CYTHON else '.c'
extensions = [Extension('prj._mod', ['prj/_mod' + ext])]
if USE_CYTHON:
extensions = cythonize(extensions)
args = dict(
... | 25.016949 | 73 | 0.604336 | from distutils.command.build_ext import build_ext
from distutils.errors import (CCompilerError, DistutilsExecError,
DistutilsPlatformError)
from setuptools import Extension, setup
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False... | 0 | 0 | 0 | 473 | 0 | 0 | 0 | 126 | 90 |
6e39cafd38ccaf3686f22fe82f721f9fdcf4a7e2 | 2,833 | py | Python | ask-smapi-model/ask_smapi_model/v1/skill/manifest/custom/suppressed_interface.py | alexa-labs/alexa-apis-for-python | 52838be4f57ee1a2479402ea78b1247b56017942 | [
"Apache-2.0"
] | 90 | 2018-09-19T21:56:42.000Z | 2022-03-30T11:25:21.000Z | ask-smapi-model/ask_smapi_model/v1/skill/manifest/custom/suppressed_interface.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 11 | 2018-09-23T12:16:48.000Z | 2021-06-10T19:49:45.000Z | ask-smapi-model/ask_smapi_model/v1/skill/manifest/custom/suppressed_interface.py | ishitaojha/alexa-apis-for-python | a68f94b7a0e41f819595d6fe56e800403e8a4194 | [
"Apache-2.0"
] | 28 | 2018-09-19T22:30:38.000Z | 2022-02-22T22:57:07.000Z | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 35.4125 | 369 | 0.715143 | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 0 | 0 | 0 | 2,028 | 0 | 0 | 0 | 7 | 178 |
6d2b8635261249ca7683308f227bee628e4dba54 | 4,150 | py | Python | mail.py | pokerG/Evernote2kindle | 13c25a72cb8b502720b1bc51121f8ff230467c73 | [
"MIT"
] | 3 | 2016-01-13T16:30:49.000Z | 2018-11-12T12:49:09.000Z | mail.py | pokerG/Evernote2kindle | 13c25a72cb8b502720b1bc51121f8ff230467c73 | [
"MIT"
] | 1 | 2015-01-16T09:43:44.000Z | 2015-01-16T14:36:14.000Z | mail.py | pokerG/Evernote2kindle | 13c25a72cb8b502720b1bc51121f8ff230467c73 | [
"MIT"
] | 2 | 2015-03-27T00:19:55.000Z | 2021-11-11T07:22:12.000Z | # -*- coding: utf-8 -*-
import httplib2
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run
import base64
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image ... | 33.467742 | 88 | 0.673253 | # -*- coding: utf-8 -*-
import httplib2
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import run
import base64
from email.mime.audio import MIMEAudio
from email.mime.base import MIMEBase
from email.mime.image ... | 0 | 0 | 0 | 0 | 0 | 1,250 | 0 | 0 | 23 |
4ac218d7ea527b17208ec1d752b29b243c8114d3 | 4,281 | py | Python | scratch/rtsp/flir_videostream.py | johnnewto/FLIR-pubsub | 71eec3a5bf8fe5959cf997f7f12d9cfe0f58d8fc | [
"Apache-2.0"
] | null | null | null | scratch/rtsp/flir_videostream.py | johnnewto/FLIR-pubsub | 71eec3a5bf8fe5959cf997f7f12d9cfe0f58d8fc | [
"Apache-2.0"
] | 6 | 2021-05-20T12:36:50.000Z | 2022-02-26T06:25:11.000Z | scratch/rtsp/flir_videostream.py | johnnewto/FLIR-pubsub | 71eec3a5bf8fe5959cf997f7f12d9cfe0f58d8fc | [
"Apache-2.0"
] | 1 | 2020-03-24T02:07:21.000Z | 2020-03-24T02:07:21.000Z | # import the necessary packages
| 25.331361 | 92 | 0.683719 | # import the necessary packages
from threading import Thread
import cv2, time
from FLIR_pubsub.FLIR_client_utils import *
class Flir_VideoStream:
""" Maintain live FLIRCam feed without buffering. """
def __init__(self, src=0, name="FlirVideoStream", verbose = False):
"""
src: the path to an RTSP server. sh... | 0 | 0 | 0 | 4,095 | 0 | 0 | 0 | 18 | 136 |
d8745b38983055f152e550e1310e6937ffe1176b | 210 | py | Python | output/models/sun_data/ctype/p_substitutions/p_substitutions00101m/p_substitutions00101m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/sun_data/ctype/p_substitutions/p_substitutions00101m/p_substitutions00101m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/sun_data/ctype/p_substitutions/p_substitutions00101m/p_substitutions00101m_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.sun_data.ctype.p_substitutions.p_substitutions00101m.p_substitutions00101m_xsd.p_substitutions00101m import (A, B, C, E)
__all__ = [
"A",
"B",
"C",
"E",
]
| 15 | 128 | 0.628571 | from output.models.sun_data.ctype.p_substitutions.p_substitutions00101m.p_substitutions00101m_xsd.p_substitutions00101m import (
A,
B,
C,
E,
)
__all__ = [
"A",
"B",
"C",
"E",
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0 |
2059aac1d6d0b0e8d8baf7f33f48f03a7991f817 | 1,972 | py | Python | problems/chapter16/mshibatatt/007_supple.py | tokuma09/algorithm_problems | 58534620df73b230afbeb12de126174362625a78 | [
"CC0-1.0"
] | 1 | 2021-07-07T15:46:58.000Z | 2021-07-07T15:46:58.000Z | problems/chapter16/mshibatatt/007_supple.py | tokuma09/algorithm_problems | 58534620df73b230afbeb12de126174362625a78 | [
"CC0-1.0"
] | 5 | 2021-06-05T14:16:41.000Z | 2021-07-10T07:08:28.000Z | problems/chapter16/mshibatatt/007_supple.py | tokuma09/algorithm_problems | 58534620df73b230afbeb12de126174362625a78 | [
"CC0-1.0"
] | null | null | null | # %%
import subprocess
import sys
reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
installed_packages = [r.decode().split('==')[0] for r in reqs.split()]
if not 'matplotlib' in installed_packages:
subprocess.run('pip install matplotlib', shell=True)
import networkx as nx
import matplotlib.pyp... | 30.8125 | 71 | 0.556795 | # %%
import subprocess
import sys
from networkx.algorithms.bipartite.basic import color
reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
installed_packages = [r.decode().split('==')[0] for r in reqs.split()]
if not 'matplotlib' in installed_packages:
subprocess.run('pip install matplotlib', ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 32 | 23 |
9b4f4d7160635a05e94c2e88c70e2e875c8ea756 | 2,256 | py | Python | 2-dl-container/Container-Root/job/resnet/compile_model-gpu.py | kamranjkhan/aws-reinvent21-inf1-workshop | d5c94dc4a53779e6b5d30581295fe98e4055c270 | [
"MIT-0"
] | 5 | 2021-11-29T22:01:15.000Z | 2022-03-08T00:55:49.000Z | 2-dl-container/Container-Root/job/resnet/compile_model-gpu.py | kamranjkhan/aws-reinvent21-inf1-workshop | d5c94dc4a53779e6b5d30581295fe98e4055c270 | [
"MIT-0"
] | null | null | null | 2-dl-container/Container-Root/job/resnet/compile_model-gpu.py | kamranjkhan/aws-reinvent21-inf1-workshop | d5c94dc4a53779e6b5d30581295fe98e4055c270 | [
"MIT-0"
] | 2 | 2021-11-16T22:49:37.000Z | 2021-11-23T23:19:29.000Z | ######################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# SPDX-License-Identifier: MIT-0 #
######################################################################
import os
import torch
import torch... | 34.181818 | 99 | 0.717642 | ######################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# SPDX-License-Identifier: MIT-0 #
######################################################################
import os
import torch
import torch... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0a3981c85cdd123a552a2bd637dd23bb7d8c7572 | 10,305 | py | Python | otcextensions/osclient/cce/v1/cluster_node.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 10 | 2018-03-03T17:59:59.000Z | 2020-01-08T10:03:00.000Z | otcextensions/osclient/cce/v1/cluster_node.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 208 | 2020-02-10T08:27:46.000Z | 2022-03-29T15:24:21.000Z | otcextensions/osclient/cce/v1/cluster_node.py | zsoltn/python-otcextensions | 4c0fa22f095ebd5f9636ae72acbae5048096822c | [
"Apache-2.0"
] | 15 | 2020-04-01T20:45:54.000Z | 2022-03-23T12:45:43.000Z | # 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 by applicable law or agreed to in writing, software
# distrib... | 34.122517 | 79 | 0.545075 | # 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 by applicable law or agreed to in writing, software
# distrib... | 0 | 0 | 0 | 7,951 | 0 | 0 | 0 | 23 | 182 |
ecb327fcb8ea5565310991e7e5a2418452557c97 | 4,199 | py | Python | ext5.py | ccvv804/FairyTaleExtractor | 797351308f72704410515b2ee37454d01e71bfc7 | [
"MIT"
] | null | null | null | ext5.py | ccvv804/FairyTaleExtractor | 797351308f72704410515b2ee37454d01e71bfc7 | [
"MIT"
] | null | null | null | ext5.py | ccvv804/FairyTaleExtractor | 797351308f72704410515b2ee37454d01e71bfc7 | [
"MIT"
] | null | null | null | import zlib
import os
import sys
import re
'''
5 2021 04 30
'''
def ():
=open(,'rb')
=.read()
.close()
#=os.getcwd()
= os.path.splitext(os.path.basename())[0]
try:
os.mkdir()
except FileExistsError:
print(' ! !')
os.chdir()
=int.fr... | 32.804688 | 95 | 0.508931 | import zlib
import os
import sys
import re
'''
동화나라 침공 계획
동화나라 추출기
5판 2021년 04월 30일
'''
def 메인프로그램(파일경로):
오픈파일=open(파일경로,'rb')
읽은데이터=오픈파일.read()
오픈파일.close()
#현재폴더위치=os.getcwd()
신파일이름 = os.path.splitext(os.path.basename(파일경로))[0]
try:
os.mkdir(신파일이름)
except File... | 3,456 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8ab04722582af4caed7c1c2acccc0756654425bc | 8,636 | py | Python | src/_cffi_src/openssl/x509.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 4,492 | 2015-01-02T23:02:52.000Z | 2022-03-31T12:59:57.000Z | src/_cffi_src/openssl/x509.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 3,692 | 2015-01-01T03:16:56.000Z | 2022-03-31T19:20:25.000Z | src/_cffi_src/openssl/x509.py | jonathanslenders/cryptography | 2535e557872ac2f94355eb8a91a598f5cfc8afcf | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | 1,155 | 2015-01-09T00:48:05.000Z | 2022-03-31T23:46:43.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
INCLUDES = """
#include <openssl/ssl.h>
/*
* This is part of a work-around for the difficulty cffi has in dealing with
* `STACK_OF(foo)... | 35.834025 | 79 | 0.769222 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
INCLUDES = """
#include <openssl/ssl.h>
/*
* This is part of a work-around for the difficulty cffi has in dealing with
* `STACK_OF(foo)... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
25f5b4b5e2f8574183c401cac6b187d76f453379 | 2,689 | py | Python | scripts/run_ann.py | lconaboy/seren3 | 5a2ec80adf0d69664d2ee874f5ba12cc02d6c337 | [
"CNRI-Python"
] | 1 | 2017-09-21T14:58:23.000Z | 2017-09-21T14:58:23.000Z | scripts/run_ann.py | lconaboy/seren3 | 5a2ec80adf0d69664d2ee874f5ba12cc02d6c337 | [
"CNRI-Python"
] | 1 | 2020-09-09T08:52:43.000Z | 2020-09-09T08:52:43.000Z | scripts/run_ann.py | lconaboy/seren3 | 5a2ec80adf0d69664d2ee874f5ba12cc02d6c337 | [
"CNRI-Python"
] | 1 | 2019-01-21T10:57:41.000Z | 2019-01-21T10:57:41.000Z |
if __name__ == "__main__":
import sys, os
ioutputs = [42, 48, 60, 70, 80, 90, 100, 106]
NN = int(sys.argv[1])
weights_fname = "/lustre/scratch/astro/ds381/simulations/baryfrac/bc03_fesc2_nohm/neural-net2/NN%i.weights" % NN
# weights_fname = "/lustre/scratch/astro/ds381/simulations/baryfrac/bc03_f... | 38.971014 | 163 | 0.645593 | def _get_predict_fname(out_dir, ioutput, weight, pdf_sampling):
if pdf_sampling:
return "%s/fb_%05i_%s_ftidal_pdf_sampling.predict" % (out_dir, ioutput, weight)
return "%s/fb_%05i_%s.predict" % (out_dir, ioutput, weight)
def _get_results_fname(out_dir, ioutput, weight, NN, pdf_sampling):
if pdf_sam... | 0 | 0 | 0 | 0 | 0 | 1,427 | 0 | 0 | 68 |
1b618726cdccd77b79583613b2080b6d3103becb | 381 | py | Python | src/definitions.py | FriendsOfGalaxy/galaxy-integration-epic | 370bd3be60c94482a143b51ed3b22f9781625cdb | [
"MIT"
] | 34 | 2019-06-27T07:04:00.000Z | 2022-03-08T13:50:14.000Z | src/definitions.py | FriendsOfGalaxy/galaxy-integration-epic | 370bd3be60c94482a143b51ed3b22f9781625cdb | [
"MIT"
] | 11 | 2019-09-07T12:42:41.000Z | 2020-07-24T12:24:27.000Z | src/definitions.py | FriendsOfGalaxy/galaxy-integration-epic | 370bd3be60c94482a143b51ed3b22f9781625cdb | [
"MIT"
] | 4 | 2020-02-09T00:10:31.000Z | 2022-02-02T14:14:04.000Z | from collections import namedtuple
Asset = namedtuple("Asset", ["namespace", "app_name", "catalog_id"])
CatalogItem = namedtuple("CatalogItem", ["id", "title", "categories"])
| 20.052632 | 70 | 0.716535 | from collections import namedtuple
import dataclasses
Asset = namedtuple("Asset", ["namespace", "app_name", "catalog_id"])
CatalogItem = namedtuple("CatalogItem", ["id", "title", "categories"])
@dataclasses.dataclass
class GameInfo:
namespace: str
app_name: str
title: str
@dataclasses.dataclass
class Ep... | 0 | 139 | 0 | 0 | 0 | 0 | 0 | -3 | 68 |
7096a10f3edad1c6a9a070b71183ae416eb95c7f | 1,594 | py | Python | src/ny_map/time_series_trend.py | graveszhang/2019-nCoV-Diffusion-Visualization | dd452994b2c43cf723950f8538cc913968efb836 | [
"MIT"
] | 2 | 2020-01-27T09:23:48.000Z | 2020-02-07T18:24:30.000Z | src/ny_map/time_series_trend.py | graveszhang/Beat-COVID-19-using-SIR-and-Graph-Neural-Networks | dd452994b2c43cf723950f8538cc913968efb836 | [
"MIT"
] | null | null | null | src/ny_map/time_series_trend.py | graveszhang/Beat-COVID-19-using-SIR-and-Graph-Neural-Networks | dd452994b2c43cf723950f8538cc913968efb836 | [
"MIT"
] | 3 | 2020-01-27T09:02:50.000Z | 2020-01-29T14:04:01.000Z | import csv
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('ggplot')
age_data = './coronavirus-data-master/archive/case-hosp-death.csv'
txt = []
with open(age_data, 'r', newline='') as file:
reader = csv.reader(file)
for line in reader:
txt.append(line)
header = txt[0]
dates = []
fo... | 30.075472 | 116 | 0.620452 | import csv
import matplotlib.pyplot as plt
import datetime
import numpy as np
plt.style.use('ggplot')
age_data = './coronavirus-data-master/archive/case-hosp-death.csv'
txt = []
with open(age_data, 'r', newline='') as file:
reader = csv.reader(file)
for line in reader:
txt.append(line)
header = txt[... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -6 | 22 |
ada5783324023798ea2f9aaac554503f82d4da36 | 373 | py | Python | code/test_dec.py | briansune/python_timer_destinator | 01beffa46f36db3e5aa9ff21c474b75aba6635ff | [
"MIT"
] | 1 | 2022-03-30T20:37:30.000Z | 2022-03-30T20:37:30.000Z | code/test_dec.py | briansune/python_timer_destinator | 01beffa46f36db3e5aa9ff21c474b75aba6635ff | [
"MIT"
] | null | null | null | code/test_dec.py | briansune/python_timer_destinator | 01beffa46f36db3e5aa9ff21c474b75aba6635ff | [
"MIT"
] | null | null | null | import logging
logging.basicConfig(level=logging.INFO)
logging.info('Start~')
res = method_run(logging)
print(len(res))
print(res)
| 18.65 | 42 | 0.788204 | import logging
import test_wrap
@test_wrap.timeCountWrapper
@test_wrap.setupConfigsWrapper
@test_wrap.loopAntennaWrapper
@test_wrap.loopPowerWrapper
@test_wrap.loopChannelWrapper
def method_run(olog):
# olog.info('Inputs: {}'.format(None))
pass
logging.basicConfig(level=logging.INFO)
logging.info('Start~')
... | 0 | 199 | 0 | 0 | 0 | 0 | 0 | -5 | 45 |
36632b6d1a76fdbaf2cab5da191fcf5cf6e8103c | 655 | py | Python | unpredictableArray.py | DhruvSalot/MyPy | 02b215b27cc1c3c865aa98d822ccc3a9842f030f | [
"MIT"
] | 1 | 2021-03-20T12:46:35.000Z | 2021-03-20T12:46:35.000Z | unpredictableArray.py | DhruvSalot/MyPy | 02b215b27cc1c3c865aa98d822ccc3a9842f030f | [
"MIT"
] | null | null | null | unpredictableArray.py | DhruvSalot/MyPy | 02b215b27cc1c3c865aa98d822ccc3a9842f030f | [
"MIT"
] | null | null | null | # ZUBSPOIL
# https://www.codechef.com/problems/ZUBSPOIL
testCase = input()
line2 = [int(i) for i in input().split()]
array = [int(i) for i in input().split()]
testList = []
for noOfTest in range(line2[1]):
testList.append([int(i) for i in input().split()])
print ("Case: " + testCase)
for k in range(len(testL... | 24.259259 | 67 | 0.671756 | # ZUBSPOIL
# https://www.codechef.com/problems/ZUBSPOIL
def valueOfArray(listOfInt):
value = 0
for i in range(len(listOfInt)-1):
value += abs(listOfInt[i]-listOfInt[i+1])
return(value)
def repList(listToRep, repWhat):
return ([repWhat[1] if l == repWhat[0] else l for l in listToRep])
testCase = input(... | 0 | 0 | 0 | 0 | 0 | 196 | 0 | 0 | 46 |
718845e1e39c7608372ee21d67ad5c63110eecb7 | 187 | py | Python | 01-Python/07-django/mysite/TestModel/admin.py | Jerrywx/Python_Down | 361d6bb8a5f7768c7064e97c40e4f485ece14a27 | [
"Apache-2.0"
] | null | null | null | 01-Python/07-django/mysite/TestModel/admin.py | Jerrywx/Python_Down | 361d6bb8a5f7768c7064e97c40e4f485ece14a27 | [
"Apache-2.0"
] | null | null | null | 01-Python/07-django/mysite/TestModel/admin.py | Jerrywx/Python_Down | 361d6bb8a5f7768c7064e97c40e4f485ece14a27 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
# Register your models here.
from django.contrib import admin
from TestModel.models import Test
# Register your models here.
admin.site.register(Test) | 18.7 | 33 | 0.802139 | from django.contrib import admin
# Register your models here.
from django.contrib import admin
from TestModel.models import Test
# Register your models here.
admin.site.register(Test) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c21d48a5c9622935e4842f542a60c0ef8093873b | 5,489 | py | Python | amplify/agent/objects/nginx/binary.py | dp92987/nginx-amplify-agent | 1b2eed6eab52a82f35974928d75044451b4bedaf | [
"BSD-2-Clause"
] | 308 | 2015-11-17T13:15:33.000Z | 2022-03-24T12:03:40.000Z | amplify/agent/objects/nginx/binary.py | dp92987/nginx-amplify-agent | 1b2eed6eab52a82f35974928d75044451b4bedaf | [
"BSD-2-Clause"
] | 211 | 2015-11-16T15:27:41.000Z | 2022-03-28T16:20:15.000Z | amplify/agent/objects/nginx/binary.py | dp92987/nginx-amplify-agent | 1b2eed6eab52a82f35974928d75044451b4bedaf | [
"BSD-2-Clause"
] | 80 | 2015-11-16T18:20:30.000Z | 2022-03-02T12:47:56.000Z | # -*- coding: utf-8 -*-
import re
from amplify.agent.common.util import subp
from amplify.agent.common.context import context
__author__ = "Mike Belov"
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
__license__ = ""
__maintainer__ = "Mike Belov"
__email__ = "dedm@nginx.com"
DEFAULT_PREFIX = '/usr/l... | 32.672619 | 111 | 0.587903 | # -*- coding: utf-8 -*-
import re
from amplify.agent.common.util import subp
from amplify.agent.common.context import context
__author__ = "Mike Belov"
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
__license__ = ""
__maintainer__ = "Mike Belov"
__email__ = "dedm@nginx.com"
DEFAULT_PREFIX = '/usr/l... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2371ee3c7adc9526ab87c102cf9e8fa26f249e6b | 655 | py | Python | 2loadconstruct.py | 21kmegerusca/MyProject | 1be72f40ff9b2927b824a979f6f5fb3a93efa1f9 | [
"MIT"
] | null | null | null | 2loadconstruct.py | 21kmegerusca/MyProject | 1be72f40ff9b2927b824a979f6f5fb3a93efa1f9 | [
"MIT"
] | null | null | null | 2loadconstruct.py | 21kmegerusca/MyProject | 1be72f40ff9b2927b824a979f6f5fb3a93efa1f9 | [
"MIT"
] | null | null | null | from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import pickle
# structure
myFile = open("myFile.txt", "rb")
structure = pickle.load(myFile)
myFile.close()
pos = mc.player.getTilePos()
x = pos.x
y = pos.y
z = pos.z
buildStructure(x, y, z, structure)
| 25.192308 | 59 | 0.560305 | from mcpi.minecraft import Minecraft
mc = Minecraft.create()
import pickle
def buildStructure(x, y, z, structure):
xStart = x
zStart = z
for row in structure:
for column in row:
for block in column:
mc.setBlock(x, y, z, block.id, block.data)
z +=... | 78 | 0 | 0 | 0 | 0 | 303 | 0 | 0 | 23 |
c1b3446c4b039f3fafcef279b1fa9e624900ad0f | 10,379 | py | Python | RunThis.py | VisweshK/Jashmup | ca0cf639000734c5aea8583d9477af9a387f6d46 | [
"MIT"
] | null | null | null | RunThis.py | VisweshK/Jashmup | ca0cf639000734c5aea8583d9477af9a387f6d46 | [
"MIT"
] | null | null | null | RunThis.py | VisweshK/Jashmup | ca0cf639000734c5aea8583d9477af9a387f6d46 | [
"MIT"
] | null | null | null | '''
Controls:
To move your ship up and down, press and hold the up and down keys respectively.
To fire a laser at enemy ships, press the space key. (Only one may be on screen at a time.)
When the game has ended, press R to Restart the game.
Your ship begins with 3 shields. After the 3 are depleted... | 45.722467 | 141 | 0.614606 | '''
Controls:
To move your ship up and down, press and hold the up and down keys respectively.
To fire a laser at enemy ships, press the space key. (Only one may be on screen at a time.)
When the game has ended, press R to Restart the game.
Your ship begins with 3 shields. After the 3 are depleted... | 0 | 0 | 0 | 0 | 0 | 9,485 | 0 | 60 | 68 |
fbd1dee91196c264ee44850acb08c9dec4ced670 | 1,919 | py | Python | apps/controllerx/cx_core/action_type/call_service_action_type.py | xaviml/z2m_ikea_controller | e612af5a913e8b4784dcaa23ea5319115427d083 | [
"MIT"
] | 19 | 2019-11-21T19:51:40.000Z | 2020-01-14T09:24:33.000Z | apps/controllerx/cx_core/action_type/call_service_action_type.py | xaviml/z2m_ikea_controller | e612af5a913e8b4784dcaa23ea5319115427d083 | [
"MIT"
] | 11 | 2019-11-20T16:43:35.000Z | 2020-01-17T16:23:06.000Z | apps/controllerx/cx_core/action_type/call_service_action_type.py | xaviml/z2m_ikea_controller | e612af5a913e8b4784dcaa23ea5319115427d083 | [
"MIT"
] | 5 | 2019-12-20T21:31:07.000Z | 2020-01-06T18:49:52.000Z | from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 36.207547 | 81 | 0.654508 | from typing import TYPE_CHECKING, Any, Dict, Optional, cast
from cx_core.action_type.base import ActionType
from cx_core.integration import EventData
if TYPE_CHECKING:
from cx_core.type_controller import Entity, TypeController
class CallServiceActionType(ActionType):
service: str
# Priority order for en... | 0 | 0 | 287 | 1,375 | 0 | 0 | 0 | 110 | 94 |
31f5519335f0dbeb8a9abfe2868d419663a404d2 | 80 | py | Python | twitoff/__init__.py | fwenchino/TwitOff | 715325264fb114591b9febe06833c43ac43e7cfe | [
"MIT"
] | 1 | 2019-09-04T15:24:04.000Z | 2019-09-04T15:24:04.000Z | twitoff/__init__.py | fwenchino/TwitOff | 715325264fb114591b9febe06833c43ac43e7cfe | [
"MIT"
] | null | null | null | twitoff/__init__.py | fwenchino/TwitOff | 715325264fb114591b9febe06833c43ac43e7cfe | [
"MIT"
] | null | null | null | """ Entrt point for TwitOff"""
from .app import create_app
APP = create_app()
| 13.333333 | 30 | 0.7 | """ Entrt point for TwitOff"""
from .app import create_app
APP = create_app()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
59625ad5bfe6849da5d03fdab7d1c1735059a8db | 3,176 | py | Python | routes/main_routes.py | yoonhoelee/twitter_application | 0e1fdab26a972002ddeaaa83ce4fb039d3d6dcca | [
"MIT"
] | null | null | null | routes/main_routes.py | yoonhoelee/twitter_application | 0e1fdab26a972002ddeaaa83ce4fb039d3d6dcca | [
"MIT"
] | null | null | null | routes/main_routes.py | yoonhoelee/twitter_application | 0e1fdab26a972002ddeaaa83ce4fb039d3d6dcca | [
"MIT"
] | null | null | null | from flask import Blueprint
import os
from dotenv import load_dotenv
load_dotenv()
import tweepy
apikey= os.environ.get('apikey')
apipw = os.environ.get('apipw')
accesstoken = os.environ.get('accesstoken')
accesspw = os.environ.get('accesspw')
auth=tweepy.OAuthHandler(apikey, apipw)
auth.set_access_token(accesstoken... | 29.962264 | 164 | 0.644521 | from flask import Flask, render_template, request, Blueprint
from twit_app.models import User, Tweet, en, db
from sklearn.linear_model import LogisticRegression
import os, pickle
import numpy as np
from dotenv import load_dotenv
load_dotenv()
import tweepy
apikey= os.environ.get('apikey')
apipw = os.environ.get('apip... | 0 | 2,466 | 0 | 0 | 0 | 0 | 0 | 94 | 208 |
acc1b35a6d7619664a1fc082cacb3b94d8fc83ec | 1,040 | py | Python | zorrom/mb8623x.py | DanDresser/zorrom | 0fa0a10d8b7a762a5f29be1868e6c03769ebd7a6 | [
"BSD-2-Clause"
] | null | null | null | zorrom/mb8623x.py | DanDresser/zorrom | 0fa0a10d8b7a762a5f29be1868e6c03769ebd7a6 | [
"BSD-2-Clause"
] | null | null | null | zorrom/mb8623x.py | DanDresser/zorrom | 0fa0a10d8b7a762a5f29be1868e6c03769ebd7a6 | [
"BSD-2-Clause"
] | null | null | null | '''
The row and column decode logic should be up and right
Reference
https://siliconpr0n.org/map/sega/315-5571/mz_mit20x/
Rotate 90 CW to get expected rotation
Think MB86233/MB86234 is the same layout
'''
| 24.761905 | 71 | 0.592308 | from zorrom import mrom
'''
The row and column decode logic should be up and right
Reference
https://siliconpr0n.org/map/sega/315-5571/mz_mit20x/
Rotate 90 CW to get expected rotation
Think MB86233/MB86234 is the same layout
'''
class MB8623x(mrom.MaskROM):
@staticmethod
def desc(self):
return 'Fuji... | 0 | 321 | 0 | 464 | 0 | 0 | 0 | 2 | 45 |
8e568463de51361853b5ababd32cfbfd8d2f24ae | 1,975 | py | Python | Server/WebApp.py | OnurYigitArpali/ML-Algorithms-Visualization-and-Positioning | d6ef79e83c3e7c57bdae5211f8cf5c372edc5e3e | [
"MIT"
] | null | null | null | Server/WebApp.py | OnurYigitArpali/ML-Algorithms-Visualization-and-Positioning | d6ef79e83c3e7c57bdae5211f8cf5c372edc5e3e | [
"MIT"
] | null | null | null | Server/WebApp.py | OnurYigitArpali/ML-Algorithms-Visualization-and-Positioning | d6ef79e83c3e7c57bdae5211f8cf5c372edc5e3e | [
"MIT"
] | null | null | null | from flask import Flask
from threading import Thread
import sys
sys.path.append("..")
app = Flask(__name__)
Thread(target=bk_worker).start()
if __name__ == '__main__':
print('Opening single process Flask app with embedded Bokeh application on http://localhost:8000/')
print()
print('Multiple connec... | 29.924242 | 128 | 0.730633 | from flask import Flask, render_template, request
from threading import Thread
from bokeh.embed import server_document
from bokeh.server.server import Server
from tornado.ioloop import IOLoop
import sys
sys.path.append("..")
from Bokeh.Decision_Tree.Plot.plot_decision_tree import create_figure
from Bokeh.K_Means.kmean... | 0 | 602 | 0 | 0 | 0 | 409 | 0 | 196 | 294 |
c84b458a3ec86af06a8780b7d6f62a876c098970 | 5,927 | py | Python | main.py | wintechis/RDeF | 459b26acefa30f42f3c3a237efb3f737c3038d7b | [
"MIT"
] | null | null | null | main.py | wintechis/RDeF | 459b26acefa30f42f3c3a237efb3f737c3038d7b | [
"MIT"
] | null | null | null | main.py | wintechis/RDeF | 459b26acefa30f42f3c3a237efb3f737c3038d7b | [
"MIT"
] | null | null | null | #####################################
## Set Variable for Logger Path #####
import os
os.environ['KIVY_HOME'] = os.getcwd()
import kivy.logger
###################################
## Kivy Import
import kivy
kivy.require('2.0.0')
#### Update standard font, if defined
#from kivy.config import Config
#Config.set('kivy', '... | 31.865591 | 178 | 0.540071 | #####################################
## Set Variable for Logger Path #####
from dataclasses import dataclass, field, asdict
import os
import json
from typing import Iterator, List, Dict
os.environ['KIVY_HOME'] = os.getcwd()
import kivy.logger
###################################
## Kivy Import
import kivy
kivy.require... | 0 | 486 | 0 | 3,809 | 0 | 0 | 0 | 137 | 312 |
6edea2709166fa4f2e012d33caf1ef89888887ac | 1,393 | py | Python | omnifig/modes.py | felixludos/omni-f | 0bbe0bc362c332483877eff3a19266b60c175ad4 | [
"MIT"
] | 1 | 2021-04-13T14:01:48.000Z | 2021-04-13T14:01:48.000Z | omnifig/modes.py | felixludos/omni-f | 0bbe0bc362c332483877eff3a19266b60c175ad4 | [
"MIT"
] | null | null | null | omnifig/modes.py | felixludos/omni-f | 0bbe0bc362c332483877eff3a19266b60c175ad4 | [
"MIT"
] | 1 | 2021-11-24T13:36:41.000Z | 2021-11-24T13:36:41.000Z | # from .registry import Component, get_script
from omnibelt import get_printer
prt = get_printer(__name__)
| 28.428571 | 113 | 0.731515 |
from .errors import MissingScriptError
# from .registry import Component, get_script
from .top import find_script
from .decorators import Component
from .util import autofill_args
from omnibelt import get_printer
prt = get_printer(__name__)
@Component('run_mode/default')
class Run_Mode:
'''
Run mo... | 0 | 1,112 | 0 | 0 | 0 | 0 | 0 | 46 | 119 |
307e167f40b4313a1e56a2da1d964893d273e387 | 3,255 | py | Python | scripts/new_patient_pipeline/new_pt_qc_script.py | MELDProject/meld_classifier | 487a6a0df2e7c359101a7a58100f438c5aac6a60 | [
"MIT"
] | 1 | 2022-03-16T15:01:07.000Z | 2022-03-16T15:01:07.000Z | scripts/new_patient_pipeline/new_pt_qc_script.py | MELDProject/meld_classifier | 487a6a0df2e7c359101a7a58100f438c5aac6a60 | [
"MIT"
] | 1 | 2022-02-14T13:46:21.000Z | 2022-02-14T13:46:21.000Z | scripts/new_patient_pipeline/new_pt_qc_script.py | MELDProject/meld_classifier | 487a6a0df2e7c359101a7a58100f438c5aac6a60 | [
"MIT"
] | null | null | null | ## This script open freeview with MRI images, MELD predictions and surfaces for quality check of segmentation
## To run : python new_pt_qc_script.py -id <sub_id>
import os
import argparse
import subprocess as sub
from meld_classifier.paths import MELD_DATA_PATH, FS_SUBJECTS_PATH
if __name__ == '__main__':
... | 41.202532 | 229 | 0.640553 | ## This script open freeview with MRI images, MELD predictions and surfaces for quality check of segmentation
## To run : python new_pt_qc_script.py -id <sub_id>
import os
import sys
import argparse
import subprocess as sub
import glob
from meld_classifier.paths import MELD_DATA_PATH, FS_SUBJECTS_PATH
def return_f... | 0 | 0 | 0 | 0 | 0 | 370 | 0 | -21 | 67 |
dc97e001fefbe37271405841d29fb05df667c08e | 2,001 | py | Python | chapter_4/4_6_successor.py | elishaking/CTCi | 6a91fd67e8765e5abef72c5b247f4d5444945438 | [
"MIT"
] | 1 | 2020-07-03T09:47:34.000Z | 2020-07-03T09:47:34.000Z | chapter_4/4_6_successor.py | elishaking/CTCi | 6a91fd67e8765e5abef72c5b247f4d5444945438 | [
"MIT"
] | null | null | null | chapter_4/4_6_successor.py | elishaking/CTCi | 6a91fd67e8765e5abef72c5b247f4d5444945438 | [
"MIT"
] | null | null | null | import unittest
# Time complexity: O(log(N))
# Space complexity: O(1)
if __name__ == "__main__":
unittest.main()
| 27.791667 | 70 | 0.593203 | import unittest
class BSTNodeP:
def __init__(self, value=0, parent=None, left=None, right=None):
self.value = value
self.left = left
self.right = right
self.parent = parent
def __str__(self):
return str(self.value)
class BSTP:
def __init__(self, root_value=0):
... | 0 | 0 | 0 | 1,278 | 0 | 508 | 0 | 0 | 91 |
8a85f3036c67974130bf8da629d90eecc39be1ee | 32,156 | py | Python | python/mirtex_benchmark/summarizeResults.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | python/mirtex_benchmark/summarizeResults.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | python/mirtex_benchmark/summarizeResults.py | mjoppich/miRExplore | 32760d88d65e7bc23b2bfb49415efcd0a7c7c5e1 | [
"Apache-2.0"
] | null | null | null | import sys
sys.path.insert(0, "/mnt/f/dev/git/miRExplore/python/")
from textdb.MiGenRelDB import MiGenRelDB
from textdb.SentenceDB import SentenceDB
from collections import defaultdict
from natsort import natsorted
sentDB, _ = SentenceDB.loadFromFile("./test/", "./development/pmid2sent", returnAll=True, redoPmid2Se... | 40.963057 | 327 | 0.645572 | import os,sys
sys.path.insert(0, "/mnt/f/dev/git/miRExplore/python/")
import time
from textdb.MiGenRelDB import MiGenRelDB
from textdb.SentenceDB import SentenceDB
from collections import defaultdict
from natsort import natsorted
sentDB, _ = SentenceDB.loadFromFile("./test/", "./development/pmid2sent", returnAll=T... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -7 | 23 |
e3267be3ca3ccbb7412f02733ff2024c2d162104 | 1,033 | py | Python | contacts/handle_contacts.py | intelligent-soft-robots/pam_demos | d4fd3939456f51aeb63d4c22e681bb0930aeeb95 | [
"BSD-3-Clause"
] | null | null | null | contacts/handle_contacts.py | intelligent-soft-robots/pam_demos | d4fd3939456f51aeb63d4c22e681bb0930aeeb95 | [
"BSD-3-Clause"
] | null | null | null | contacts/handle_contacts.py | intelligent-soft-robots/pam_demos | d4fd3939456f51aeb63d4c22e681bb0930aeeb95 | [
"BSD-3-Clause"
] | null | null | null |
MUJOCO_ID = "pam_demos_contacts"
ROBOT_SEGMENT_ID = "robot"
BALL_SEGMENT_ID = "ball"
| 22.955556 | 75 | 0.723136 | import pam_mujoco
MUJOCO_ID = "pam_demos_contacts"
ROBOT_SEGMENT_ID = "robot"
BALL_SEGMENT_ID = "ball"
def get_handle(robot_contact):
global MUJOCO_ID, ROBOT_SEGMENT_ID, BALL_SEGMENT_ID
robot_control = pam_mujoco.MujocoRobot.JOINT_CONTROL
robot = pam_mujoco.MujocoRobot(ROBOT_SEGMENT_ID, control=robot_c... | 0 | 0 | 0 | 0 | 0 | 857 | 0 | -4 | 91 |
591e412704a3ebc443c6a2063e7b566975c4afd3 | 513 | py | Python | Dataset/Leetcode/valid/11/37.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/valid/11/37.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/valid/11/37.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null |
undefined
for (i = 0; i < document.getElementsByTagName("code").length; i++) { console.log(document.getElementsByTagName("code")[i].innerText); }
| 27 | 139 | 0.516569 | class Solution(object):
def XXX(self, height):
"""
:type height: List[int]
:rtype: int
"""
a = 0
for index, X in enumerate(height):
for j in range(len(height)):
res = min(X, height[j])
location = index - j
a ... | 0 | 0 | 0 | 339 | 0 | 0 | 0 | 0 | 22 |
6803063230b074a8261628bbd89a6a9dc198905b | 5,296 | py | Python | scripts/evaluate-clusters.py | gmcgoldr/theissues | 4e4c9eb66c543cdbcda4f1b96a7d2b163450368c | [
"MIT"
] | 1 | 2021-12-07T11:23:32.000Z | 2021-12-07T11:23:32.000Z | scripts/evaluate-clusters.py | gmcgoldr/theissues | 4e4c9eb66c543cdbcda4f1b96a7d2b163450368c | [
"MIT"
] | null | null | null | scripts/evaluate-clusters.py | gmcgoldr/theissues | 4e4c9eb66c543cdbcda4f1b96a7d2b163450368c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Evaluate the proximity of statements in pre-defined clusters.
"""
from pathlib import Path
import numpy as np
def distances_euclid(x: np.ndarray, y: np.ndarray) -> np.ndarray:
"""
Calculate the pair-wise distance between each vector in `x` and `y`, where
the eucledian space is... | 32.292683 | 81 | 0.668429 | #!/usr/bin/env python3
"""
Evaluate the proximity of statements in pre-defined clusters.
"""
import json
import logging
import sys
import warnings
from pathlib import Path
import numpy as np
import tokenizers as tk
import torch
from theissues import clustering, training, utils
def distances_euclid(x: np.ndarray, ... | 8 | 0 | 0 | 0 | 0 | 3,992 | 0 | -13 | 179 |
49a88a53c6e84b35803c714c51ea020c2ec9b5d8 | 1,361 | py | Python | tests/unit/conftest.py | Joeper214/blueoil | 5aeb6634770011753b8d5ae283b91b7a0050101e | [
"Apache-2.0"
] | 248 | 2018-10-19T01:48:42.000Z | 2022-01-31T02:34:24.000Z | tests/unit/conftest.py | Joeper214/blueoil | 5aeb6634770011753b8d5ae283b91b7a0050101e | [
"Apache-2.0"
] | 1,102 | 2018-10-19T04:50:34.000Z | 2021-08-02T04:22:10.000Z | tests/unit/conftest.py | Joeper214/blueoil | 5aeb6634770011753b8d5ae283b91b7a0050101e | [
"Apache-2.0"
] | 110 | 2018-10-19T01:49:02.000Z | 2022-01-31T02:34:26.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil Authors. All Rights Reserved.
#
# 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
#
# Unles... | 34.897436 | 119 | 0.710507 | # -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil Authors. All Rights Reserved.
#
# 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
#
# Unles... | 0 | 533 | 0 | 0 | 0 | 0 | 0 | 4 | 113 |
448034f959c02c6a99d686799cb1dc0584474a86 | 2,485 | py | Python | observations/r/wage.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | observations/r/wage.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | observations/r/wage.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from observations.util import maybe_download_and_extract
def wage(path):
"""Mid-Atlantic Wage Data
Wage and other data for a group of 3000 workers in the Mid-Atlantic
... | 25.357143 | 72 | 0.663581 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def wage(path):
"""Mid-Atlantic Wage Data
Wage and other data for a gr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -25 | 67 |
77487db3218aff34e9120776d952281b311e7b4d | 1,271 | py | Python | accounts/models.py | tony-joseph/crimson-publisher | a156d0b6f681c1b3ffba890d9581f3a3b78d0d1d | [
"BSD-3-Clause"
] | 1 | 2020-05-06T16:59:43.000Z | 2020-05-06T16:59:43.000Z | accounts/models.py | tony-joseph/crimson-publisher | a156d0b6f681c1b3ffba890d9581f3a3b78d0d1d | [
"BSD-3-Clause"
] | null | null | null | accounts/models.py | tony-joseph/crimson-publisher | a156d0b6f681c1b3ffba890d9581f3a3b78d0d1d | [
"BSD-3-Clause"
] | null | null | null |
GENDER_CHOICES = (
('Male', 'Male'),
('Female', 'Female'),
('Not specified', 'Not specified')
)
| 37.382353 | 105 | 0.719906 | from django.db import models
from django.contrib.auth.models import User
GENDER_CHOICES = (
('Male', 'Male'),
('Female', 'Female'),
('Not specified', 'Not specified')
)
class UserProfile(models.Model):
""" Model to store the user profile.
"""
user = models.OneToOneField(User, on_delete=mod... | 0 | 0 | 0 | 1,063 | 0 | 0 | 0 | 29 | 68 |
7decd07b5d1a2b477e3ef3c630f2faec37d8b26d | 2,132 | py | Python | tests/test_identifier_translation.py | ini-bdds/minid | 7cd1eea02ccf4274f1094406090eeaf28d1d3b5d | [
"Apache-2.0"
] | 6 | 2015-12-10T18:04:16.000Z | 2018-02-16T20:55:19.000Z | tests/test_identifier_translation.py | fair-research/minid | 08f29d293c72fabe3560af55246a9acb34432f1f | [
"Apache-2.0"
] | 33 | 2018-03-28T19:20:34.000Z | 2021-12-03T00:06:17.000Z | tests/test_identifier_translation.py | fair-research/minid | 08f29d293c72fabe3560af55246a9acb34432f1f | [
"Apache-2.0"
] | 6 | 2018-05-22T15:51:32.000Z | 2021-08-19T13:51:12.000Z |
import minid
PROD_HDL = 'hdl:20.500.12582/prod_ident_xyz'
TEST_HDL = 'hdl:20.500.12633/test_ident_xyz'
PROD_MINID = 'minid:prod_ident_xyz'
TEST_MINID = 'minid.test:test_ident_xyz'
# The ordering is ('identifier', 'to_type', 'expected_result')
VALID_MINID_TRANSLATIONS = [
(PROD_HDL, 'minid', PROD_MINID),
(PRO... | 27.333333 | 76 | 0.734053 | import pytest
import minid
PROD_HDL = 'hdl:20.500.12582/prod_ident_xyz'
TEST_HDL = 'hdl:20.500.12633/test_ident_xyz'
PROD_MINID = 'minid:prod_ident_xyz'
TEST_MINID = 'minid.test:test_ident_xyz'
# The ordering is ('identifier', 'to_type', 'expected_result')
VALID_MINID_TRANSLATIONS = [
(PROD_HDL, 'minid', PROD_MI... | 0 | 454 | 0 | 0 | 0 | 603 | 0 | -8 | 206 |
8c523ff21cce00bfb6508a566525191ce5e43acb | 1,713 | py | Python | webscraper.py | cdaconta/ufc_fan | 7039150d73f1288f5ceb9d21a32bbaed4d2ec988 | [
"MIT"
] | null | null | null | webscraper.py | cdaconta/ufc_fan | 7039150d73f1288f5ceb9d21a32bbaed4d2ec988 | [
"MIT"
] | null | null | null | webscraper.py | cdaconta/ufc_fan | 7039150d73f1288f5ceb9d21a32bbaed4d2ec988 | [
"MIT"
] | null | null | null | from selenium import webdriver
import os
# This can be tested at heroku.com in 'Run console' with command: python webscraper.py
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument("--no-sandbox")
chrome_... | 34.959184 | 113 | 0.690601 | from selenium import webdriver
from selenium.webdriver.common.by import By
import os
# This can be tested at heroku.com in 'Run console' with command: python webscraper.py
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 22 |
d727da06f635bc5fc0091a3943521f05ad08ca22 | 974 | py | Python | submissions/continuous-subarray-sum/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | null | null | null | submissions/continuous-subarray-sum/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | 1 | 2022-03-04T20:24:32.000Z | 2022-03-04T20:31:58.000Z | submissions/continuous-subarray-sum/solution.py | Wattyyy/LeetCode | 13a9be056d0a0c38c2f8c8222b11dc02cb25a935 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/continuous-subarray-sum
| 30.4375 | 80 | 0.530801 | # https://leetcode.com/problems/continuous-subarray-sum
from itertools import accumulate
from collections import defaultdict
class Solution:
def checkSubarraySum(self, nums, k):
if len(nums) <= 1:
return False
if k == 0:
cum_sum = list(accumulate(nums))
cum_su... | 0 | 0 | 0 | 824 | 0 | 0 | 0 | 25 | 68 |
86b5822d95b8149ce13290b83517f3ea31869ed9 | 56,405 | py | Python | plugins/recorded_future/komand_recorded_future/actions/search_domains/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/recorded_future/komand_recorded_future/actions/search_domains/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/recorded_future/komand_recorded_future/actions/search_domains/schema.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
| 27.394366 | 97 | 0.338995 | # GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "This action is used to search for results related to a specific parent domain"
class Input:
DIRECTION = "direction"
FROM = "from"
LIMIT = "limit"
ORDERBY = "orderby"
PAREN... | 0 | 0 | 0 | 56,188 | 0 | 0 | 0 | 5 | 159 |
968fc9ee7c3afd380ee0778dfce3ba487abb9fa8 | 1,483 | py | Python | edd/notify/consumers.py | TeselaGen/jbei-edd | 92792fb30bbd504143b2f75bf08d05b141a7ef6f | [
"BSD-3-Clause-LBNL"
] | null | null | null | edd/notify/consumers.py | TeselaGen/jbei-edd | 92792fb30bbd504143b2f75bf08d05b141a7ef6f | [
"BSD-3-Clause-LBNL"
] | null | null | null | edd/notify/consumers.py | TeselaGen/jbei-edd | 92792fb30bbd504143b2f75bf08d05b141a7ef6f | [
"BSD-3-Clause-LBNL"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
| 29.66 | 93 | 0.706001 | # -*- coding: utf-8 -*-
import logging
from channels import Group
from channels.generic.websockets import JsonWebsocketConsumer
from django.contrib import messages
from edd import utilities
from .backend import DefaultBroker
logger = logging.getLogger(__name__)
class NotifySubscribeConsumer(JsonWebsocketConsumer... | 0 | 150 | 0 | 1,042 | 0 | 0 | 0 | 76 | 135 |
3545431f028e9eb49ec16cddb7c5e0538efd2cfe | 4,174 | py | Python | src/pyTiming/stringlength.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 98 | 2015-01-01T12:46:05.000Z | 2022-02-13T14:17:36.000Z | src/pyTiming/stringlength.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 46 | 2015-02-10T19:53:38.000Z | 2022-01-11T17:26:05.000Z | src/pyTiming/stringlength.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 38 | 2015-01-08T17:00:34.000Z | 2022-03-04T05:15:22.000Z | import numpy as np
from PyAstronomy import pyasl
from PyAstronomy.pyaC import pyaErrors as PE
def stringlength_norm(m, norm):
"""
Normalize string length data set.
Parameters
----------
m : array
Data array
norm : string, {default, no}
If 'default' (default), the data poin... | 31.621212 | 99 | 0.56828 | import numpy as np
from PyAstronomy import pyasl
from PyAstronomy.pyaC import pyaErrors as PE
def stringlength_norm(m, norm):
"""
Normalize string length data set.
Parameters
----------
m : array
Data array
norm : string, {default, no}
If 'default' (default), the data poin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0868a262e1105712c1b1459683a752f900db5d7c | 455 | py | Python | fab_helper/util.py | toracle/fab_helper | 50bdf0c750e72e6b66360e067e05ab2e80f2948d | [
"MIT"
] | null | null | null | fab_helper/util.py | toracle/fab_helper | 50bdf0c750e72e6b66360e067e05ab2e80f2948d | [
"MIT"
] | null | null | null | fab_helper/util.py | toracle/fab_helper | 50bdf0c750e72e6b66360e067e05ab2e80f2948d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 28.4375 | 136 | 0.738462 | # -*- coding: utf-8 -*-
import fabric
from fabric.api import run
import fabtools
def install_python_devel():
fabtools.rpm.groupinstall('Development Tools')
fabtools.rpm.install('python-devel')
def match_and_delete_n_lines(remote_path, pattern, num_lines):
if fabric.contrib.files.exists(remote_path):
... | 0 | 0 | 0 | 0 | 0 | 325 | 0 | -9 | 113 |
1d1cf28f9a480197bd37ce0c43f7a7abc65c8070 | 815,413 | py | Python | pfxbrick/pfxtestdata.py | fx-bricks/pfx-brick-py | dacd3c04fcbbecef7a6a5d9603ed8cf9a2eb3469 | [
"MIT"
] | 11 | 2018-04-26T22:53:44.000Z | 2022-02-14T13:44:27.000Z | pfxbrick/pfxtestdata.py | fx-bricks/pfx-brick-py | dacd3c04fcbbecef7a6a5d9603ed8cf9a2eb3469 | [
"MIT"
] | 3 | 2021-01-14T18:48:48.000Z | 2022-02-16T04:06:06.000Z | pfxbrick/pfxtestdata.py | fx-bricks/pfx-brick-py | dacd3c04fcbbecef7a6a5d9603ed8cf9a2eb3469 | [
"MIT"
] | 2 | 2018-05-20T11:30:53.000Z | 2022-02-15T06:42:37.000Z | # fmt: off
PINKFILE = """
UklGRvIEAgBXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0Yc4EAgAAALEA3ABmAukA1wCb/8QA9P+y/2D7QgIvBXUL3wpvAff7P/X0+Lb7OApo/OkBhwE3AbwIHxO1DCMOVAYeCOsTCRdNB6oQgBeeCb3/1AErDCMH8gMQBh0IgAb++r8M3Ql4EEgbtR4MDPMHzQPSBpQNIRjVGfcarwd2FF0W0RpYDF4Y1Q2DDhIcHRdxINwOSR70FsEbMiFsGO8M3waaER0elBVRCncFPg70Dm0AxwkkC... | 50,963.3125 | 462,396 | 0.93215 | # fmt: off
PINKFILE = """
UklGRvIEAgBXQVZFZm10IBAAAAABAAEAIlYAAESsAAACABAAZGF0Yc4EAgAAALEA3ABmAukA1wCb/8QA9P+y/2D7QgIvBXUL3wpvAff7P/X0+Lb7OApo/OkBhwE3AbwIHxO1DCMOVAYeCOsTCRdNB6oQgBeeCb3/1AErDCMH8gMQBh0IgAb++r8M3Ql4EEgbtR4MDPMHzQPSBpQNIRjVGfcarwd2FF0W0RpYDF4Y1Q2DDhIcHRdxINwOSR70FsEbMiFsGO8M3waaER0elBVRCncFPg70Dm0AxwkkC... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1c156e5f122bf8807853c07fb26f3bbb780b1d00 | 852 | py | Python | tests/test_var.py | caterinaurban/apronpy | 8a7e08e6929beeeeb97a9da648499be8c5d18bff | [
"MIT"
] | 7 | 2019-02-19T18:55:13.000Z | 2019-10-08T10:32:40.000Z | tests/test_var.py | caterinaurban/apronpy | 8a7e08e6929beeeeb97a9da648499be8c5d18bff | [
"MIT"
] | 3 | 2020-05-26T21:08:29.000Z | 2020-08-28T13:10:47.000Z | tests/test_var.py | caterinaurban/apronpy | 8a7e08e6929beeeeb97a9da648499be8c5d18bff | [
"MIT"
] | 1 | 2022-03-29T15:01:27.000Z | 2022-03-29T15:01:27.000Z | """
APRON (String) Variables - Unit Tests
=====================================
:Author: Caterina Urban
"""
import unittest
if __name__ == '__main__':
unittest.main()
| 23.666667 | 51 | 0.566901 | """
APRON (String) Variables - Unit Tests
=====================================
:Author: Caterina Urban
"""
import unittest
from copy import deepcopy
from apronpy.var import PyVar
class TestPyVar(unittest.TestCase):
def test_init(self):
self.assertEqual(str(PyVar('x0')), 'x0')
self.assertEqual(... | 0 | 0 | 0 | 597 | 0 | 0 | 0 | 12 | 68 |
a41227fd0193d99680d0f36404faf90aaae3bc70 | 184 | py | Python | deep_learning_zero/ch1/pyplot_img_smpl.py | kaito0223/shakyou | 8d901b4da24fbf0c708e3eb429a57d194e9857c1 | [
"MIT"
] | null | null | null | deep_learning_zero/ch1/pyplot_img_smpl.py | kaito0223/shakyou | 8d901b4da24fbf0c708e3eb429a57d194e9857c1 | [
"MIT"
] | null | null | null | deep_learning_zero/ch1/pyplot_img_smpl.py | kaito0223/shakyou | 8d901b4da24fbf0c708e3eb429a57d194e9857c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from matplotlib.image import imread
#img= imread('suzume.jpg')
img= imread('../images/suzume.jpg')
plt.imshow(img)
plt.show()
| 18.4 | 35 | 0.701087 | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from matplotlib.image import imread
#img= imread('suzume.jpg')
img= imread('../images/suzume.jpg')
plt.imshow(img)
plt.show()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16767bf10a073eb4b835f38554354ba050908bd5 | 16,703 | py | Python | protac_lib.py | Limsande/PRosettaC | 9cc9e11d045c9961fbdb667e700a98a46723a45b | [
"MIT"
] | 14 | 2020-09-27T07:23:07.000Z | 2022-03-02T08:19:02.000Z | protac_lib.py | Limsande/PRosettaC | 9cc9e11d045c9961fbdb667e700a98a46723a45b | [
"MIT"
] | 5 | 2021-08-19T02:31:25.000Z | 2022-03-04T15:43:22.000Z | protac_lib.py | Limsande/PRosettaC | 9cc9e11d045c9961fbdb667e700a98a46723a45b | [
"MIT"
] | 14 | 2020-09-30T09:30:10.000Z | 2022-02-28T14:14:08.000Z | from rdkit.Geometry.rdGeometry import Point3D
import numpy as np
def x_rotation(vector,theta):
"""Rotates 3-D vector around x-axis"""
R = np.array([[1,0,0],[0,np.cos(theta),-np.sin(theta)],[0, np.sin(theta), np.cos(theta)]])
output = np.dot(R, [vector.x, vector.y, vector.z])
return Point3D(output[0], o... | 45.887363 | 173 | 0.639406 | import sys
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import rdFMCS
from rdkit.Chem import rdMolAlign
from rdkit.Chem import rdMolTransforms
from rdkit.Geometry.rdGeometry import Point3D
from rdkit.Chem.rdchem import Atom
import utils
import numpy as np
import math
import glob
import random
i... | 0 | 0 | 0 | 0 | 0 | 14,838 | 0 | 2 | 558 |
cdeb3e0137ee70f18fbc7cc85f5b046edb6fe4bc | 5,787 | py | Python | exportucd.py | fsonner/blenderucdexport | bf7f35e54a13cacd46c9183edb3eacd9c900572e | [
"MIT"
] | null | null | null | exportucd.py | fsonner/blenderucdexport | bf7f35e54a13cacd46c9183edb3eacd9c900572e | [
"MIT"
] | null | null | null | exportucd.py | fsonner/blenderucdexport | bf7f35e54a13cacd46c9183edb3eacd9c900572e | [
"MIT"
] | null | null | null | bl_info = {
"name": "Export to AVS/UCD.ASCII (.inp)",
"author": "Florian Sonner",
"version": (1, 0),
"blender": (2, 7, 4),
"location": "File > Export > AVS/UCD.ASCII (.inp)",
"description": "Export 2d polygonials to AVS/UCD file format (ASCII variant) and assigns colors to edges. Ignores z coordinates.",
... | 27.29717 | 134 | 0.648523 | bl_info = {
"name": "Export to AVS/UCD.ASCII (.inp)",
"author": "Florian Sonner",
"version": (1, 0),
"blender": (2, 7, 4),
"location": "File > Export > AVS/UCD.ASCII (.inp)",
"description": "Export 2d polygonials to AVS/UCD file format (ASCII variant) and assigns colors to edges. Ignores z coordinates.",
... | 0 | 67 | 0 | 1,012 | 0 | 3,985 | 0 | 13 | 248 |
7d1983c111802e041733d8571194da3cc7ff5e99 | 823 | py | Python | src/yellowdog_client/images/__init__.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/images/__init__.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | src/yellowdog_client/images/__init__.py | yellowdog/yellowdog-sdk-python-public | da69a7d6e45c92933e34fefcaef8b5d98dcd6036 | [
"Apache-2.0"
] | null | null | null | import jsons
from .images_client import ImagesClient
from .images_client_impl import ImagesClientImpl
from .images_service_proxy import ImagesServiceProxy
from .page import Page
from .pageable import Pageable
from .sort import Sort
jsons.set_deserializer(page_deserializer, Page)
__all__ = [
"ImagesClient",
... | 22.861111 | 74 | 0.749696 | from typing import List
from typish import get_args
import jsons
from jsons import default_list_deserializer
from yellowdog_client.common.json import object_deserializer
from .images_client import ImagesClient
from .images_client_impl import ImagesClientImpl
from .images_service_proxy import ImagesServiceProxy
from .... | 0 | 0 | 0 | 0 | 0 | 234 | 0 | 69 | 113 |
8c6ab31581a9c7037911dce238b5276604ae1423 | 1,639 | py | Python | python/houghP.py | dennyzz/Pathfinder-v2 | e7853c1b86d0c76ebbf7c1b68aa76fadcf37f7fc | [
"MIT"
] | null | null | null | python/houghP.py | dennyzz/Pathfinder-v2 | e7853c1b86d0c76ebbf7c1b68aa76fadcf37f7fc | [
"MIT"
] | null | null | null | python/houghP.py | dennyzz/Pathfinder-v2 | e7853c1b86d0c76ebbf7c1b68aa76fadcf37f7fc | [
"MIT"
] | null | null | null | import cv2
import numpy as np
cap = cv2.VideoCapture("0degree.mp4")
fps = cap.get(cv2.CAP_PROP_FPS)
print(fps)
count = 0
sum_x1 = 0
sum_y1 = 0
sum_x2 = 0
sum_y2 = 0
while(True):
ret, frame = cap.read()
ysize = frame.shape[0]
xsize = frame.shape[1]
left = frame[0:ysize, 0:int(xsize/2)]
right = frame[0:ysize, ... | 19.987805 | 74 | 0.66565 | import time
import cv2
import numpy as np
cap = cv2.VideoCapture("0degree.mp4")
fps = cap.get(cv2.CAP_PROP_FPS)
print(fps)
count = 0
sum_x1 = 0
sum_y1 = 0
sum_x2 = 0
sum_y2 = 0
while(True):
ret, frame = cap.read()
ysize = frame.shape[0]
xsize = frame.shape[1]
left = frame[0:ysize, 0:int(xsize/2)]
right = fra... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
ac55f0cccf6e22b2c103658745fde781bbe7dd8d | 1,511 | py | Python | echoAI/Activation/Torch/aria2.py | ksasi/Echo | f1cc3a91a7fe4239b0160d7aa43224b941951809 | [
"MIT"
] | null | null | null | echoAI/Activation/Torch/aria2.py | ksasi/Echo | f1cc3a91a7fe4239b0160d7aa43224b941951809 | [
"MIT"
] | null | null | null | echoAI/Activation/Torch/aria2.py | ksasi/Echo | f1cc3a91a7fe4239b0160d7aa43224b941951809 | [
"MIT"
] | 1 | 2022-02-07T16:55:52.000Z | 2022-02-07T16:55:52.000Z | '''
Applies the Aria-2 function element-wise:
.. math::
Aria2(x, \\alpha, \\beta) = (1+e^{-\\beta*x})^{-\\alpha}
See Aria paper:
https://arxiv.org/abs/1805.08878
'''
# import pytorch
# import activation functions
| 22.893939 | 208 | 0.576439 | '''
Applies the Aria-2 function element-wise:
.. math::
Aria2(x, \\alpha, \\beta) = (1+e^{-\\beta*x})^{-\\alpha}
See Aria paper:
https://arxiv.org/abs/1805.08878
'''
# import pytorch
import torch
from torch import nn
# import activation functions
import echoAI.Activation.Torch.functional as Func
class Aria2(n... | 0 | 0 | 0 | 1,182 | 0 | 0 | 0 | 18 | 89 |
d149062275e73950d85cd4f9289855812a0cafa0 | 9,644 | py | Python | lambda.py | ldonayre/SmartLight | 105dc6b4fe245407083a501bf032de1180cabe21 | [
"Apache-2.0"
] | 5 | 2018-03-21T10:52:58.000Z | 2021-04-21T01:04:15.000Z | lambda.py | ldonayre/SmartLight | 105dc6b4fe245407083a501bf032de1180cabe21 | [
"Apache-2.0"
] | null | null | null | lambda.py | ldonayre/SmartLight | 105dc6b4fe245407083a501bf032de1180cabe21 | [
"Apache-2.0"
] | 3 | 2018-02-28T07:44:52.000Z | 2020-03-24T17:47:02.000Z | from __future__ import print_function
##############################
# Required Intents
##############################
##############################
# On Launch
##############################
##############################
# Routing
##############################
# Called when the session starts
if __... | 32.802721 | 155 | 0.604314 | from __future__ import print_function
import requests
import json
import boto3
def build_response_payload( title, output, reprompt_text, should_end_session ):
return {
'outputSpeech': {
'type': 'PlainText',
'text': output
},
'card': {
'type': 'Simple',
... | 0 | 0 | 0 | 0 | 0 | 7,481 | 0 | -25 | 434 |
468d3e640cfac79f2138feb9e894964ff89b3045 | 1,270 | py | Python | expansions/game/code.py | croot/blacksmith-2 | 3bb544139a18184a709ca7668f8e69f3ca361475 | [
"Apache-2.0"
] | null | null | null | expansions/game/code.py | croot/blacksmith-2 | 3bb544139a18184a709ca7668f8e69f3ca361475 | [
"Apache-2.0"
] | null | null | null | expansions/game/code.py | croot/blacksmith-2 | 3bb544139a18184a709ca7668f8e69f3ca361475 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# BlackSmith mark.2
# exp_name = "game" # /code.py v.x2
# Id: 26~2c
# Code (2011) by WitcherGeralt [alkorgun@gmail.com]
del GameChrLS, GameRules
| 21.166667 | 77 | 0.619685 | # coding: utf-8
# BlackSmith mark.2
# exp_name = "game" # /code.py v.x2
# Id: 26~2c
# Code © (2011) by WitcherGeralt [alkorgun@gmail.com]
class expansion_temp(expansion):
def __init__(self, name):
expansion.__init__(self, name)
GameDesc = {
GameChrLS[0]: {
GameChrLS[1]: 9,
GameChrLS[3]: 2
},
Ga... | 2 | 0 | 0 | 1,079 | 0 | 0 | 0 | 0 | 23 |
f8a97a2a59447bb0a11fc4d20e93cb511048ed29 | 481 | py | Python | server/the_water_project/topics/migrations/0008_auto_20210718_1720.py | Subhra264/the-water-project | f9f7244a58d87cadc89dd501ca2cf602dac86877 | [
"Apache-2.0"
] | 1 | 2021-06-12T05:10:43.000Z | 2021-06-12T05:10:43.000Z | server/the_water_project/topics/migrations/0008_auto_20210718_1720.py | Abhra303/the-water-project | d05f854fbafe676f3ee51d10e78ca7fafec33b7d | [
"Apache-2.0"
] | 2 | 2021-07-05T10:15:48.000Z | 2022-01-02T14:52:00.000Z | server/the_water_project/topics/migrations/0008_auto_20210718_1720.py | Abhra303/the-water-project | d05f854fbafe676f3ee51d10e78ca7fafec33b7d | [
"Apache-2.0"
] | 1 | 2021-06-12T05:10:51.000Z | 2021-06-12T05:10:51.000Z | # Generated by Django 3.2.4 on 2021-07-18 11:50
| 21.863636 | 60 | 0.555094 | # Generated by Django 3.2.4 on 2021-07-18 11:50
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("topics", "0007_auto_20210717_1646"),
]
operations = [
migrations.AlterModelOptions(
name="issue",
options={"ordering": ("-da... | 0 | 0 | 0 | 375 | 0 | 0 | 0 | 11 | 46 |
575d6551e01e79ddeea79868ff78dde487e68298 | 764 | py | Python | cracking_the_coding_interview/chapter_17/min_unsorted_seq1.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | 2 | 2017-02-17T01:40:27.000Z | 2018-04-22T12:47:28.000Z | cracking_the_coding_interview/chapter_17/min_unsorted_seq1.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | null | null | null | cracking_the_coding_interview/chapter_17/min_unsorted_seq1.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | 1 | 2016-10-14T06:00:42.000Z | 2016-10-14T06:00:42.000Z | # Interview Question 17.6
# Time complexity: O(n^2)
# Auxiliary space complexity: O(n)
if __name__ == '__main__':
integers = []
print(min_unsorted_seq(integers))
integers = [1, 2, 4, 7, 10, 11, 7, 12, 6, 7, 16, 18, 19]
print(min_unsorted_seq(integers))
integers = list(range(13))
print(min_... | 23.875 | 71 | 0.589005 | # Interview Question 17.6
# Time complexity: O(n^2)
# Auxiliary space complexity: O(n)
def min_unsorted_seq(intergers):
if not integers:
return 0, 0
N = len(integers)
farthest_less_than = [0] * N
for i in range(N):
for j in range(i, N):
if integers[j] < integers[i]:
... | 0 | 0 | 0 | 0 | 0 | 397 | 0 | 0 | 23 |
370f3623edfeb82ef759bf9a646da3b3b874800c | 2,865 | py | Python | model/layers.py | zzzqzhou/Dual-Normalization | b9831b6e2662a950600ba37ada087ba8ce93f60c | [
"MIT"
] | 12 | 2022-03-10T09:24:41.000Z | 2022-03-30T03:36:51.000Z | model/layers.py | zzzqzhou/Dual-Normalization | b9831b6e2662a950600ba37ada087ba8ce93f60c | [
"MIT"
] | 1 | 2022-03-30T09:41:23.000Z | 2022-03-30T09:41:23.000Z | model/layers.py | zzzqzhou/Dual-Normalization | b9831b6e2662a950600ba37ada087ba8ce93f60c | [
"MIT"
] | null | null | null | """
Wrappers for the operations to take the meta-learning gradient
updates into account.
"""
import torch.autograd as autograd
"""
The following are the new methods for 2D-Unet:
Conv2d, batchnorm2d, GroupNorm, InstanceNorm2d, MaxPool2d, UpSample
"""
#as per the 2D Unet: kernel_size, stride, padding | 31.141304 | 116 | 0.672949 | """
Wrappers for the operations to take the meta-learning gradient
updates into account.
"""
import torch.autograd as autograd
import torch.nn.functional as F
from torch.autograd import Variable
def linear(inputs, weight, bias, meta_step_size=0.001, meta_loss=None, stop_gradient=False):
# inputs = inputs.cuda()
... | 0 | 0 | 0 | 0 | 0 | 2,215 | 0 | 24 | 320 |
9e5eb2b827274a017acaf55b36d14238660ffe36 | 233 | py | Python | setup.py | nokludge/python-keypad | 16cb8d7a4fd5f2b6ab62e2a8f2878555cb6ae88e | [
"MIT"
] | null | null | null | setup.py | nokludge/python-keypad | 16cb8d7a4fd5f2b6ab62e2a8f2878555cb6ae88e | [
"MIT"
] | null | null | null | setup.py | nokludge/python-keypad | 16cb8d7a4fd5f2b6ab62e2a8f2878555cb6ae88e | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='Keymatrix',
version='0.3',
packages=['keypad'],
license='MIT',
author='Ruslan Walch',
long_description=open('README.md').read(),
install_requires=['rpi.gpio'],
)
| 19.416667 | 46 | 0.635193 | from setuptools import setup
setup(
name='Keymatrix',
version='0.3',
packages=['keypad'],
license='MIT',
author='Ruslan Walch',
long_description=open('README.md').read(),
install_requires=['rpi.gpio'],
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4f4961c01c421d11775c321b49638d004490d794 | 1,100 | py | Python | lmk/calculator/EntryPointCalculator.py | dyno/LMK | f2c40dbbf5eeaacd9db738e4f0cc1f3d326e39bf | [
"MIT"
] | 12 | 2016-07-08T02:46:59.000Z | 2022-03-03T02:41:47.000Z | lmk/calculator/EntryPointCalculator.py | dyno/LMK | f2c40dbbf5eeaacd9db738e4f0cc1f3d326e39bf | [
"MIT"
] | 4 | 2020-12-10T04:04:46.000Z | 2021-07-26T14:57:36.000Z | lmk/calculator/EntryPointCalculator.py | dyno/LMK | f2c40dbbf5eeaacd9db738e4f0cc1f3d326e39bf | [
"MIT"
] | 5 | 2018-09-01T00:08:53.000Z | 2021-08-13T15:18:25.000Z | """EntryPointCalculator
Entry/Buy: price > btm + atr/2
Exit/Sell: price < top - atr/2
"""
BUY = 1
SELL = 2
| 26.190476 | 94 | 0.551818 | """EntryPointCalculator
Entry/Buy: price > btm + atr/2
Exit/Sell: price < top - atr/2
"""
BUY = 1
SELL = 2
class EntryPointCalculator(object):
def __init__(self, trade_type=BUY, atr_factor=1.0):
self.trade_type = trade_type
self.atr_factor = atr_factor
self.pivot = None
self.wait... | 0 | 0 | 0 | 967 | 0 | 0 | 0 | 0 | 23 |
17f86476d0946b6fc0ff6cb392a95b805716a250 | 1,838 | py | Python | web_scrape.py | OSAMAMOHAMED1234/python_projects | fb4bc7356847c3f46df690a9386cf970377a6f7c | [
"MIT"
] | null | null | null | web_scrape.py | OSAMAMOHAMED1234/python_projects | fb4bc7356847c3f46df690a9386cf970377a6f7c | [
"MIT"
] | null | null | null | web_scrape.py | OSAMAMOHAMED1234/python_projects | fb4bc7356847c3f46df690a9386cf970377a6f7c | [
"MIT"
] | null | null | null | import sys
if __name__ == '__main__':
try:
start = int(sys.argv[1])
except:
start = None
try:
count = int(sys.argv[2])
except:
count = 0
run(start_year=start, years_ago=count) # python test.py 2021 5 | 25.527778 | 85 | 0.683896 |
import datetime
import os
import pandas as pd
import requests
import sys
from requests_html import HTML
def url_to_txt(url, save=False):
r = requests.get(url)
if r.status_code == 200:
html_text = r.text
return html_text
return None
def parse_and_extract(url, name='2021'):
html_text = url_to_txt(url... | 0 | 0 | 0 | 0 | 0 | 1,444 | 0 | -17 | 180 |
98e1bc05ad66affd281a6b035ad9896bec2ad02a | 270 | py | Python | src/apps/surveys22/urls.py | COAStatistics/alss | e1b14cb13de7b8455fa6835587cb1ceb16e4595c | [
"MIT"
] | null | null | null | src/apps/surveys22/urls.py | COAStatistics/alss | e1b14cb13de7b8455fa6835587cb1ceb16e4595c | [
"MIT"
] | null | null | null | src/apps/surveys22/urls.py | COAStatistics/alss | e1b14cb13de7b8455fa6835587cb1ceb16e4595c | [
"MIT"
] | null | null | null | from django.urls import path
from django.conf.urls import include
from .api import api
from .views import Surveys2022Index
app_name = "surveys22"
urlpatterns = [
path("", Surveys2022Index.as_view(), name="surveys22_index"),
path("api/", include(api.urls)),
]
| 20.769231 | 65 | 0.72963 | from django.urls import path
from django.conf.urls import include
from .api import api
from .views import Surveys2022Index
app_name = "surveys22"
urlpatterns = [
path("", Surveys2022Index.as_view(), name="surveys22_index"),
path("api/", include(api.urls)),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a3193b7d564017b0ffb57b1c6fe1f381daf08ba0 | 10,125 | py | Python | tools/pyBAR_converter_old.py | jp-barron/Susi_Simulation | 2c4990ed8adbccb816e793228e5a6158a9b9a565 | [
"BSD-2-Clause"
] | null | null | null | tools/pyBAR_converter_old.py | jp-barron/Susi_Simulation | 2c4990ed8adbccb816e793228e5a6158a9b9a565 | [
"BSD-2-Clause"
] | null | null | null | tools/pyBAR_converter_old.py | jp-barron/Susi_Simulation | 2c4990ed8adbccb816e793228e5a6158a9b9a565 | [
"BSD-2-Clause"
] | null | null | null | """This script converts a hdf5 table into a CERN ROOT Ttree.
"""
if __name__ == "__main__":
input_file_name = r'/home/davidlp/geant4/SourceSim-build/SourceSimulation'
plsr_dac_calibation_file = r'/home/davidlp/git/SourceSim/converter/calibration_data/plsr_dac_scan.cfg'
tdc_calibation_file = r'/home/dav... | 61.737805 | 209 | 0.697284 | """This script converts a hdf5 table into a CERN ROOT Ttree.
"""
import tables as tb
import numpy as np
import ctypes
import progressbar
import os
import math
import ROOT as r
from pybar.fei4 import register_utils
from pybar.analysis.RawDataConverter import data_struct
def get_charge_calibration(tdc_calibation_file,... | 0 | 0 | 0 | 0 | 0 | 7,363 | 0 | 34 | 297 |
b88e429f2c73875e87dbd49011f9170925e16a53 | 504 | py | Python | base/ntp_client.py | vvvvcp/NeverMore | ec1e269460f222b89666a3e5593ffe18f928a82d | [
"Apache-2.0"
] | null | null | null | base/ntp_client.py | vvvvcp/NeverMore | ec1e269460f222b89666a3e5593ffe18f928a82d | [
"Apache-2.0"
] | null | null | null | base/ntp_client.py | vvvvcp/NeverMore | ec1e269460f222b89666a3e5593ffe18f928a82d | [
"Apache-2.0"
] | null | null | null | import socket
import struct
import sys
import time
NTP_SERVER = "0.uk.pool.ntp.org"
TIME1970 = 2208988800L
if __name__ =='__main__':
sntp_client() | 22.909091 | 60 | 0.660714 | import socket
import struct
import sys
import time
NTP_SERVER = "0.uk.pool.ntp.org"
TIME1970 = 2208988800L
def sntp_client():
client = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
data ='\x1b'+47*'\0'
client.sendto(data,(NTP_SERVER,123))
data, address = client.recvfrom(1024)
if data:
p... | 0 | 0 | 0 | 0 | 0 | 324 | 0 | 0 | 23 |
814536c9653bd63332edceb91144afb9025e14e8 | 506 | py | Python | lista2/Q1-Q14/Q10.py | AlexandrePeBrito/Python | 79a09b1fb8e705dc7b6859d977c8916a2d0dd4d0 | [
"MIT"
] | null | null | null | lista2/Q1-Q14/Q10.py | AlexandrePeBrito/Python | 79a09b1fb8e705dc7b6859d977c8916a2d0dd4d0 | [
"MIT"
] | null | null | null | lista2/Q1-Q14/Q10.py | AlexandrePeBrito/Python | 79a09b1fb8e705dc7b6859d977c8916a2d0dd4d0 | [
"MIT"
] | null | null | null | #Faa um Programa que pergunte em que turno voc estuda. Pea para digitar M-matutino ou
# VVespertino ou N- Noturno. Imprima a mensagem "Bom Dia!", "Boa Tarde!" ou "Boa Noite!" ou
#"Valor Invlido!", conforme o caso
shift = input("Informe o Turno que voce estuda M-matutino ou V-Vespertino ou N- Noturno: ")
if(shift==... | 42.166667 | 93 | 0.671937 | #Faça um Programa que pergunte em que turno você estuda. Peça para digitar M-matutino ou
# VVespertino ou N- Noturno. Imprima a mensagem "Bom Dia!", "Boa Tarde!" ou "Boa Noite!" ou
#"Valor Inválido!", conforme o caso
shift = input("Informe o Turno que voce estuda M-matutino ou V-Vespertino ou N- Noturno: ")
if(shi... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
30f81ed7e89db7217b849ad6d0f78859e2b961af | 3,008 | py | Python | testing/ball_tether_test.py | konsou/autsball | 9252a104c0f107098352ec1857f4ff5bb71931ab | [
"MIT"
] | null | null | null | testing/ball_tether_test.py | konsou/autsball | 9252a104c0f107098352ec1857f4ff5bb71931ab | [
"MIT"
] | 3 | 2017-06-27T13:39:30.000Z | 2017-07-10T10:24:53.000Z | testing/ball_tether_test.py | konsou/autsball | 9252a104c0f107098352ec1857f4ff5bb71931ab | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
import pygame, game
center_point = (400,300)
yellow = (255, 255, 0)
red = (255, 0, 0)
green = (0, 255, 0)
pygame.init()
win = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Angle finding test")
def show_text(pos, text, color=(255, 255, 255), bgcolor=(0, 0, 0), fontSize=24):... | 30.08 | 117 | 0.674867 | # -*- coding: utf8 -*-
import pygame, math, vector, game_object, game
center_point = (400,300)
yellow = (255, 255, 0)
red = (255, 0, 0)
green = (0, 255, 0)
pygame.init()
win = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Angle finding test")
class TestBall(game.BallSprite):
def __init__(self... | 12 | 0 | 0 | 1,217 | 0 | 0 | 0 | 27 | 92 |
26efd4d930a69ce9a17c164364d07a6a1d2e240d | 887 | py | Python | Scripts/englishDictionary.py | Jorgee97/Python_Projects | 187893a47b71bb0a626f740a1e9423fc45f8736f | [
"MIT"
] | null | null | null | Scripts/englishDictionary.py | Jorgee97/Python_Projects | 187893a47b71bb0a626f740a1e9423fc45f8736f | [
"MIT"
] | null | null | null | Scripts/englishDictionary.py | Jorgee97/Python_Projects | 187893a47b71bb0a626f740a1e9423fc45f8736f | [
"MIT"
] | null | null | null | import json
data = json.load(open("/home/coreman/Downloads/dictionary.json"))
s = input()
result = retrieve_def(s)
if type(result) == list:
for item in result:
print("-", item)
else:
print("-", result)
| 24.638889 | 103 | 0.599775 | import json
from difflib import get_close_matches
data = json.load(open("/home/coreman/Downloads/dictionary.json"))
def retrieve_def(word):
word = word.lower()
if word in data:
return data[word]
elif word.title() in data:
return data[word.title()]
elif word.upper() in data:
... | 0 | 0 | 0 | 0 | 0 | 601 | 0 | 16 | 45 |
c33531d9237427911f7642814fa1ec4545e853e5 | 405 | py | Python | 14/test.py | AlecRosenbaum/adventofcode2017 | 9214a64db77492790d30bbd22e835535d05abb25 | [
"MIT"
] | null | null | null | 14/test.py | AlecRosenbaum/adventofcode2017 | 9214a64db77492790d30bbd22e835535d05abb25 | [
"MIT"
] | null | null | null | 14/test.py | AlecRosenbaum/adventofcode2017 | 9214a64db77492790d30bbd22e835535d05abb25 | [
"MIT"
] | null | null | null | import unittest
TEST_INPUT = """flqrgnkx"""
if __name__ == "__main__":
unittest.main()
| 20.25 | 61 | 0.740741 | import unittest
from solution import solution_part_one, solution_part_two
TEST_INPUT = """flqrgnkx"""
class TestPartOne(unittest.TestCase):
def test_one(self):
self.assertEqual(solution_part_one(TEST_INPUT), 8108)
class TestPartTwo(unittest.TestCase):
def test_one(self):
self.assertEqual(s... | 0 | 0 | 0 | 204 | 0 | 0 | 0 | 36 | 69 |
9da0f87f8d24e2a12adc4d3f3df3720c1e2db205 | 261 | py | Python | pycleanup/__init__.py | axju/pyclean | 16ad3f44ee6ce3f2b0b12eaae220633c897580b1 | [
"MIT"
] | 1 | 2018-11-23T22:45:07.000Z | 2018-11-23T22:45:07.000Z | pycleanup/__init__.py | axju/pyclean | 16ad3f44ee6ce3f2b0b12eaae220633c897580b1 | [
"MIT"
] | 2 | 2018-11-23T23:00:05.000Z | 2019-10-10T07:39:11.000Z | pycleanup/__init__.py | axju/pyclean | 16ad3f44ee6ce3f2b0b12eaae220633c897580b1 | [
"MIT"
] | 1 | 2019-09-23T06:43:29.000Z | 2019-09-23T06:43:29.000Z | VERSION = '0.0.1'
DIR_KIND = {
'cache': {'search': '__pycache__', 'help': 'Delete the pycache folders'},
'egg': {'search': 'egg-info', 'help': 'Delete the egg folders'},
}
FILE_KIND = {
'pyc': {'search': '.pyc', 'help': 'Delete the pyc files'},
}
| 23.727273 | 77 | 0.56705 | VERSION = '0.0.1'
DIR_KIND = {
'cache': {'search': '__pycache__', 'help': 'Delete the pycache folders'},
'egg': {'search': 'egg-info', 'help': 'Delete the egg folders'},
}
FILE_KIND = {
'pyc': {'search': '.pyc', 'help': 'Delete the pyc files'},
}
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9871f89a5ce1451771af2f79157524e8f85304d8 | 217 | py | Python | tests/pep562_test/__init__.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 308 | 2016-12-07T16:49:27.000Z | 2022-03-15T10:06:45.000Z | tests/pep562_test/__init__.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1,928 | 2016-11-28T17:13:18.000Z | 2022-03-31T21:43:19.000Z | tests/pep562_test/__init__.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 311 | 2016-11-27T03:01:49.000Z | 2022-03-18T21:34:03.000Z | from ddtrace.internal.compat import ensure_pep562
ensure_pep562(__name__)
| 19.727273 | 51 | 0.732719 | from ddtrace.internal.compat import ensure_pep562
def __getattr__(name):
if name == "deprecated":
raise RuntimeError("bad module attribute!")
return "good module attribute"
ensure_pep562(__name__)
| 0 | 0 | 0 | 0 | 0 | 117 | 0 | 0 | 23 |
2090d111bf40cbb4abfec4717fd4887559b95e71 | 2,371 | py | Python | starter_templates/sqlite/python/app/main.py | knarkzel/languages | 96ea0055cd5edcd4c8658d29737f3285af4921ab | [
"MIT"
] | 8 | 2020-12-07T09:54:55.000Z | 2022-03-21T01:27:53.000Z | starter_templates/sqlite/python/app/main.py | knarkzel/languages | 96ea0055cd5edcd4c8658d29737f3285af4921ab | [
"MIT"
] | 31 | 2020-05-03T05:44:09.000Z | 2022-02-10T23:14:32.000Z | starter_templates/sqlite/python/app/main.py | knarkzel/languages | 96ea0055cd5edcd4c8658d29737f3285af4921ab | [
"MIT"
] | 14 | 2020-05-03T01:03:49.000Z | 2021-12-23T14:52:08.000Z | import sys
# import sqlparse - available if you need it!
from .record_parser import parse_record
from .varint_parser import parse_varint
database_file_path = sys.argv[1]
command = sys.argv[2]
if command == ".dbinfo":
with open(database_file_path, "rb") as database_file:
database_file.seek(100) # Ski... | 33.394366 | 114 | 0.661324 | import sys
from dataclasses import dataclass
# import sqlparse - available if you need it!
from .record_parser import parse_record
from .varint_parser import parse_varint
database_file_path = sys.argv[1]
command = sys.argv[2]
@dataclass(init=False)
class PageHeader:
page_type: int
first_free_block_start:... | 0 | 804 | 0 | 0 | 0 | 0 | 0 | 12 | 46 |
395a720e00ee7c4fa4922ced15ccf6788b7a3932 | 1,232 | py | Python | Problems/Top Interview Questions/Hard/03_merge_k_sorted_lists.py | andor2718/LeetCode | 59874f49085818e6da751f1cc26867b31079d35d | [
"BSD-3-Clause"
] | 1 | 2022-01-17T19:51:15.000Z | 2022-01-17T19:51:15.000Z | Problems/Top Interview Questions/Hard/03_merge_k_sorted_lists.py | andor2718/LeetCode | 59874f49085818e6da751f1cc26867b31079d35d | [
"BSD-3-Clause"
] | null | null | null | Problems/Top Interview Questions/Hard/03_merge_k_sorted_lists.py | andor2718/LeetCode | 59874f49085818e6da751f1cc26867b31079d35d | [
"BSD-3-Clause"
] | null | null | null | # https://leetcode.com/problems/merge-k-sorted-lists/
# Definition for singly-linked list.
# Wrapper class for ListNodes, so we can compare them by values.
| 29.333333 | 79 | 0.62013 | # https://leetcode.com/problems/merge-k-sorted-lists/
import heapq
from typing import Optional
# Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
# Wrapper class for ListNodes, so we can compare them by values.
class Entry:... | 0 | 0 | 0 | 962 | 0 | 0 | 0 | -3 | 112 |