hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7cf6655e00b12a9970e00e80d05996a30dfd700c | 2,771 | py | Python | rlgym/version.py | aidant19/rocket-league-gym | e6eebcdc9ba93ae3f94532b306b551d7cdc7c9e7 | [
"Apache-2.0"
] | null | null | null | rlgym/version.py | aidant19/rocket-league-gym | e6eebcdc9ba93ae3f94532b306b551d7cdc7c9e7 | [
"Apache-2.0"
] | null | null | null | rlgym/version.py | aidant19/rocket-league-gym | e6eebcdc9ba93ae3f94532b306b551d7cdc7c9e7 | [
"Apache-2.0"
] | null | null | null | # From https://github.com/RLBot/RLBot/blob/master/src/main/python/rlbot/version.py
# Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
# https://stackoverflow.com/questions/458550/st... | 34.6375 | 124 | 0.673042 | # From https://github.com/RLBot/RLBot/blob/master/src/main/python/rlbot/version.py
# Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
# https://stackoverflow.com/questions/458550/st... | 206 | 0 | 46 |
d4ae126233092ddd0c90cbe211ae2db9276f5cd7 | 6,442 | py | Python | structured/tests/test_varapprox.py | pberkes/identity-attributes-model | fb70bd12c6de2e6fbb243478b7f500011b29b2cf | [
"BSD-2-Clause"
] | null | null | null | structured/tests/test_varapprox.py | pberkes/identity-attributes-model | fb70bd12c6de2e6fbb243478b7f500011b29b2cf | [
"BSD-2-Clause"
] | null | null | null | structured/tests/test_varapprox.py | pberkes/identity-attributes-model | fb70bd12c6de2e6fbb243478b7f500011b29b2cf | [
"BSD-2-Clause"
] | null | null | null | import unittest
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from structured import common, gibbs, objects, varapprox
from structured.common import mult_diag
| 37.672515 | 100 | 0.572027 | import unittest
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
from structured import common, gibbs, objects, varapprox
from structured.common import mult_diag
def _random_model(T, dy, dc, dsc, params='noninformative', w_real=None):
# params: 'noninformative', 'exact... | 5,957 | 18 | 258 |
599d114d7d25d20fc362d7ca7c011a114fe461c3 | 1,327 | py | Python | pit.py | aebrahimian/alpha-zero-hex | 466ca3b08713f179390d1595e28f7a473994df54 | [
"MIT"
] | 1 | 2019-05-22T05:28:01.000Z | 2019-05-22T05:28:01.000Z | pit.py | aebrahimian/alpha-zero-hex | 466ca3b08713f179390d1595e28f7a473994df54 | [
"MIT"
] | null | null | null | pit.py | aebrahimian/alpha-zero-hex | 466ca3b08713f179390d1595e28f7a473994df54 | [
"MIT"
] | null | null | null | import Arena
from MCTS import MCTS
from hex.HexGame import HexGame, display
from hex.HexPlayers import *
from hex.pytorch.NNet import NNetWrapper as NNet
import numpy as np
from utils import *
"""
use this script to play any two agents against each other, or play manually with
any agent.
"""
g = HexGame(6)
# all pl... | 32.365854 | 117 | 0.730972 | import Arena
from MCTS import MCTS
from hex.HexGame import HexGame, display
from hex.HexPlayers import *
from hex.pytorch.NNet import NNetWrapper as NNet
import numpy as np
from utils import *
"""
use this script to play any two agents against each other, or play manually with
any agent.
"""
g = HexGame(6)
# all pl... | 0 | 0 | 0 |
8d5a6246eee0f3d586de1d54cafc2e8cfd589550 | 955 | py | Python | kaishi/core/filters/duplicate_files.py | kungfuai/kaishi | e20360170ccac2111cab61fcd71b81be3c2a7468 | [
"MIT"
] | 10 | 2020-04-01T16:46:25.000Z | 2021-02-09T15:56:42.000Z | kaishi/core/filters/duplicate_files.py | kungfuai/kaishi | e20360170ccac2111cab61fcd71b81be3c2a7468 | [
"MIT"
] | 14 | 2020-03-23T13:32:35.000Z | 2021-12-07T19:30:23.000Z | kaishi/core/filters/duplicate_files.py | kungfuai/kaishi | e20360170ccac2111cab61fcd71b81be3c2a7468 | [
"MIT"
] | 2 | 2020-08-14T07:23:06.000Z | 2021-12-06T18:20:42.000Z | """Class definition for filtering duplicate files."""
from kaishi.core.misc import find_duplicate_inds
from kaishi.core.misc import trim_list_by_inds
from kaishi.core.misc import CollapseChildren
from kaishi.core.pipeline_component import PipelineComponent
class FilterDuplicateFiles(PipelineComponent):
"""Filter ... | 35.37037 | 85 | 0.712042 | """Class definition for filtering duplicate files."""
from kaishi.core.misc import find_duplicate_inds
from kaishi.core.misc import trim_list_by_inds
from kaishi.core.misc import CollapseChildren
from kaishi.core.pipeline_component import PipelineComponent
class FilterDuplicateFiles(PipelineComponent):
"""Filter ... | 539 | 0 | 54 |
2441f4f342551be8ee448db101472c848ec925f3 | 1,320 | py | Python | teitocsv/pdftotext_reader.py | komax/teitocsv | 149e98d51abacb6335bf630ba98c254433e2d90e | [
"MIT"
] | 3 | 2020-05-10T09:08:25.000Z | 2022-03-15T07:54:11.000Z | teitocsv/pdftotext_reader.py | komax/teitocsv | 149e98d51abacb6335bf630ba98c254433e2d90e | [
"MIT"
] | 1 | 2021-12-13T19:59:35.000Z | 2021-12-13T19:59:35.000Z | teitocsv/pdftotext_reader.py | komax/teitocsv | 149e98d51abacb6335bf630ba98c254433e2d90e | [
"MIT"
] | 2 | 2020-03-22T20:30:24.000Z | 2020-07-21T05:07:16.000Z | import re
import itertools
from bacteria_regex import BacteriaMatcher
| 28.085106 | 74 | 0.632576 | import re
import itertools
from bacteria_regex import BacteriaMatcher
def read_text_file(filename, delimiter=' ', strip='\n'):
with open(filename, 'rb') as txt:
res = []
for line_bytes in txt:
line = line_bytes.decode('utf-8', 'ignore')
res.append(line.rstrip(strip))
... | 1,066 | 3 | 176 |
19b54a642f34c45ec7eb66153bc74a3be9cae35c | 7,546 | py | Python | base.py | DDMAL/diagonal-neume-slicing | 092cf8b72b32eb724db83741793057b4bfd8a855 | [
"MIT"
] | 1 | 2019-05-14T19:25:15.000Z | 2019-05-14T19:25:15.000Z | base.py | DDMAL/diagonal-neume-slicing | 092cf8b72b32eb724db83741793057b4bfd8a855 | [
"MIT"
] | 3 | 2018-12-17T17:00:28.000Z | 2021-05-12T14:29:51.000Z | base.py | DDMAL/diagonal-neume-slicing | 092cf8b72b32eb724db83741793057b4bfd8a855 | [
"MIT"
] | null | null | null | from rodan.jobs.base import RodanTask
from gamera.core import init_gamera, Image, load_image
from gamera import gamera_xml
from ProjectionSplitting import ProjectionSplitter
from DirtyLayerRepair import DirtyLayerRepairman
init_gamera()
| 36.105263 | 202 | 0.547045 | from rodan.jobs.base import RodanTask
from gamera.core import init_gamera, Image, load_image
from gamera import gamera_xml
from ProjectionSplitting import ProjectionSplitter
from DirtyLayerRepair import DirtyLayerRepairman
init_gamera()
class DiagonalNeumeSlicing(RodanTask):
name = 'Diagonal Neume Slicing'
... | 1,987 | 5,271 | 46 |
108445657c54477752b7e86578da16bddbb3bba9 | 3,080 | py | Python | handroll/composers/generic.py | iter8ve/handroll | 55a97080b82ac5dcec1e974379b22fbaacf18c99 | [
"BSD-2-Clause"
] | 17 | 2015-02-28T07:36:13.000Z | 2022-01-22T13:49:22.000Z | handroll/composers/generic.py | iter8ve/handroll | 55a97080b82ac5dcec1e974379b22fbaacf18c99 | [
"BSD-2-Clause"
] | 61 | 2015-02-24T01:12:56.000Z | 2017-10-21T18:53:26.000Z | handroll/composers/generic.py | iter8ve/handroll | 55a97080b82ac5dcec1e974379b22fbaacf18c99 | [
"BSD-2-Clause"
] | 3 | 2019-02-04T16:33:08.000Z | 2021-04-20T08:58:56.000Z | # Copyright (c) 2017, Matt Layman
import os
from handroll import logger
from handroll.composers import Composer
from handroll.composers.mixins import FrontmatterComposerMixin
from handroll.i18n import _
class GenericHTMLComposer(FrontmatterComposerMixin, Composer):
"""A template class that performs basic handli... | 35.813953 | 79 | 0.657468 | # Copyright (c) 2017, Matt Layman
import os
from handroll import logger
from handroll.composers import Composer
from handroll.composers.mixins import FrontmatterComposerMixin
from handroll.i18n import _
class GenericHTMLComposer(FrontmatterComposerMixin, Composer):
"""A template class that performs basic handli... | 85 | 0 | 53 |
240cda84528599dd6a40122be2a9dc0b0eb9a728 | 1,411 | py | Python | examples/user_examples.py | optimum-web/oneandone-cloudserver-sdk-python | d748865cda4c1d91617d9a3f0d156eb1be500799 | [
"Apache-2.0"
] | 1 | 2018-08-28T07:00:54.000Z | 2018-08-28T07:00:54.000Z | examples/user_examples.py | optimum-web/oneandone-cloudserver-sdk-python | d748865cda4c1d91617d9a3f0d156eb1be500799 | [
"Apache-2.0"
] | 8 | 2017-10-02T11:08:11.000Z | 2019-03-28T08:11:49.000Z | examples/user_examples.py | optimum-web/oneandone-cloudserver-sdk-python | d748865cda4c1d91617d9a3f0d156eb1be500799 | [
"Apache-2.0"
] | 3 | 2016-05-20T19:03:49.000Z | 2018-09-06T13:41:43.000Z | import os
from oneandone.client import OneAndOneService
token = os.getenv('ONEANDONE_TOKEN')
client = OneAndOneService(token)
# List all users
users = client.list_users()
# Retrieve a user
user = client.get_user(user_id='')
# Retrieve a user's API privileges
api_info = client.api_info(user_id='')
# Retrieve a use... | 25.196429 | 80 | 0.678951 | import os
from oneandone.client import OneAndOneService
token = os.getenv('ONEANDONE_TOKEN')
client = OneAndOneService(token)
# List all users
users = client.list_users()
# Retrieve a user
user = client.get_user(user_id='')
# Retrieve a user's API privileges
api_info = client.api_info(user_id='')
# Retrieve a use... | 0 | 0 | 0 |
8ce55caa990d80cc5d90898318feba56a889cc7f | 2,505 | py | Python | reference/sketchbook/lz/lzw.py | JaDogg/__py_playground | 416f88db10e03f5380bcb5cfcad0bca50ffa657c | [
"MIT"
] | 1 | 2015-10-28T00:00:16.000Z | 2015-10-28T00:00:16.000Z | reference/sketchbook/lz/lzw.py | JaDogg/__py_playground | 416f88db10e03f5380bcb5cfcad0bca50ffa657c | [
"MIT"
] | null | null | null | reference/sketchbook/lz/lzw.py | JaDogg/__py_playground | 416f88db10e03f5380bcb5cfcad0bca50ffa657c | [
"MIT"
] | null | null | null | """
An implementation of
http://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch
(without any entropy coder or codebook size limit)
"""
## message = 'TOBEORNOTTOBEORTOBEORNOT'
## encoded = list(encode(message))
## output = ''.join(decode(encoded))
## message == output
#. True
## list(show_lzw(message))
#. ['T', ... | 29.470588 | 91 | 0.607186 | """
An implementation of
http://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch
(without any entropy coder or codebook size limit)
"""
## message = 'TOBEORNOTTOBEORTOBEORNOT'
## encoded = list(encode(message))
## output = ''.join(decode(encoded))
## message == output
#. True
## list(show_lzw(message))
#. ['T', ... | 608 | 0 | 115 |
902d89870189fcb1803ab5b2772058e388b43d94 | 327 | py | Python | hooks/pre_gen_project.py | ovnicraft/cookiecutter-openerp | b581f753ca1c0cd6255ff5a8fd827d0142b0a5a5 | [
"MIT"
] | 2 | 2015-03-17T10:57:55.000Z | 2017-12-18T14:06:41.000Z | hooks/pre_gen_project.py | ovnicraft/cookiecutter-openerp | b581f753ca1c0cd6255ff5a8fd827d0142b0a5a5 | [
"MIT"
] | null | null | null | hooks/pre_gen_project.py | ovnicraft/cookiecutter-openerp | b581f753ca1c0cd6255ff5a8fd827d0142b0a5a5 | [
"MIT"
] | null | null | null | import os
import re
import shutil
if "{{ cookiecutter.has_models }}" == "no":
shutil.rmtree("models")
if "{{ cookiecutter.has_wizards }}" == "yes":
os.mkdir("wizards")
if "{{ cookiecutter.has_reports }}" == "yes":
os.mkdir("reports")
if "{{ cookiecutter.has_controller}}" == "yes":
os.mkdir("control... | 19.235294 | 47 | 0.626911 | import os
import re
import shutil
if "{{ cookiecutter.has_models }}" == "no":
shutil.rmtree("models")
if "{{ cookiecutter.has_wizards }}" == "yes":
os.mkdir("wizards")
if "{{ cookiecutter.has_reports }}" == "yes":
os.mkdir("reports")
if "{{ cookiecutter.has_controller}}" == "yes":
os.mkdir("control... | 0 | 0 | 0 |
292bf6f15c058d80ce78cb293146b598763a0380 | 12,647 | py | Python | makepy/commands.py | ubunatic/pimpy | 4fd129e624edf63a3e1ec55d52ff2385f3be7946 | [
"MIT"
] | 4 | 2018-08-06T07:28:30.000Z | 2021-02-03T05:48:11.000Z | makepy/commands.py | ubunatic/pimpy | 4fd129e624edf63a3e1ec55d52ff2385f3be7946 | [
"MIT"
] | null | null | null | makepy/commands.py | ubunatic/pimpy | 4fd129e624edf63a3e1ec55d52ff2385f3be7946 | [
"MIT"
] | null | null | null | from __future__ import print_function, absolute_import
from builtins import str
import sys, os, re, json, logging, errno
from datetime import datetime
from glob import glob
from os.path import join, isfile, dirname, abspath, basename
from makepy import argparse
from makepy.config import read_setup_args, package_dir, r... | 37.197059 | 100 | 0.579584 | from __future__ import print_function, absolute_import
from builtins import str
import sys, os, re, json, logging, errno
from datetime import datetime
from glob import glob
from os.path import join, isfile, dirname, abspath, basename
from makepy import argparse
from makepy.config import read_setup_args, package_dir, r... | 10,899 | 0 | 850 |
0e9b32abfc2e043475cedc75ae055f107d7a37ca | 26 | py | Python | hello.py | sagar2s/Hacktoberfest2020 | 9fe4e59c9075b177e6798512c7aa73f68d5668b4 | [
"Apache-2.0"
] | null | null | null | hello.py | sagar2s/Hacktoberfest2020 | 9fe4e59c9075b177e6798512c7aa73f68d5668b4 | [
"Apache-2.0"
] | null | null | null | hello.py | sagar2s/Hacktoberfest2020 | 9fe4e59c9075b177e6798512c7aa73f68d5668b4 | [
"Apache-2.0"
] | null | null | null | print("Hello I am Sagar")
| 13 | 25 | 0.692308 | print("Hello I am Sagar")
| 0 | 0 | 0 |
9b1b2767a0febe1147830644878e7494c6ea43f1 | 1,598 | py | Python | preprocess/SentiWordNet.py | KnightZhang625/Project_SentimentAnalysis | e68193b8811a12217f9ae117aafe7f363c9f7caa | [
"Apache-2.0"
] | null | null | null | preprocess/SentiWordNet.py | KnightZhang625/Project_SentimentAnalysis | e68193b8811a12217f9ae117aafe7f363c9f7caa | [
"Apache-2.0"
] | null | null | null | preprocess/SentiWordNet.py | KnightZhang625/Project_SentimentAnalysis | e68193b8811a12217f9ae117aafe7f363c9f7caa | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
"""The file is just for test."""
import nltk
from nltk.corpus import wordnet as wn
from nltk.corpus import sentiwordnet as swn
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
ps = PorterStemmer()
def penn_to_wn(tag):
"""
Convert betw... | 28.035088 | 112 | 0.679599 | # coding:utf-8
"""The file is just for test."""
import nltk
from nltk.corpus import wordnet as wn
from nltk.corpus import sentiwordnet as swn
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
ps = PorterStemmer()
def penn_to_wn(tag):
"""
Convert betw... | 0 | 0 | 0 |
ea9ec16a51131c3f734fad6594fcbb245bbe19a1 | 877 | py | Python | setup.py | paulo-werneck/airflow-notify-sns | 8923d6acb7542fc134e4e5119fccdfb6222dc446 | [
"MIT"
] | 5 | 2021-03-05T20:46:46.000Z | 2022-02-23T17:23:18.000Z | setup.py | paulo-werneck/airflow-notify-sns | 8923d6acb7542fc134e4e5119fccdfb6222dc446 | [
"MIT"
] | null | null | null | setup.py | paulo-werneck/airflow-notify-sns | 8923d6acb7542fc134e4e5119fccdfb6222dc446 | [
"MIT"
] | 1 | 2021-07-14T02:58:04.000Z | 2021-07-14T02:58:04.000Z | import io
from os import path
from setuptools import setup, find_packages
MYDIR = path.abspath(path.dirname(__file__))
cmdclass = {}
ext_modules = []
setup(
name='airflow-notify-sns',
version='0.0.2',
author="Marcelo Santino",
author_email="marcelo@santino.dev",
description="Publish Airflow not... | 29.233333 | 72 | 0.68073 | import io
from os import path
from setuptools import setup, find_packages
MYDIR = path.abspath(path.dirname(__file__))
cmdclass = {}
ext_modules = []
setup(
name='airflow-notify-sns',
version='0.0.2',
author="Marcelo Santino",
author_email="marcelo@santino.dev",
description="Publish Airflow not... | 0 | 0 | 0 |
b14235fd91f2de80ddba25b2b48a54d972be64b4 | 37 | py | Python | test/login.py | gq-song/test007 | 69b2a995e0192c886128ff7f05594ab4119c7375 | [
"MIT"
] | null | null | null | test/login.py | gq-song/test007 | 69b2a995e0192c886128ff7f05594ab4119c7375 | [
"MIT"
] | null | null | null | test/login.py | gq-song/test007 | 69b2a995e0192c886128ff7f05594ab4119c7375 | [
"MIT"
] | null | null | null | num = 10
num2 =20
num3 =300
num4 =40
| 7.4 | 9 | 0.648649 | num = 10
num2 =20
num3 =300
num4 =40
| 0 | 0 | 0 |
5cc347581d278f3074fda17de20a117c64223427 | 1,109 | py | Python | mbox/koji_builder.py | puiterwijk/mbox | 9ec3c6312ca4fe893b77a927bd572a7489208767 | [
"MIT"
] | 8 | 2019-04-23T13:18:01.000Z | 2020-05-21T05:28:55.000Z | mbox/koji_builder.py | puiterwijk/mbox | 9ec3c6312ca4fe893b77a927bd572a7489208767 | [
"MIT"
] | 2 | 2019-03-14T02:31:13.000Z | 2019-09-25T16:33:51.000Z | mbox/koji_builder.py | puiterwijk/mbox | 9ec3c6312ca4fe893b77a927bd572a7489208767 | [
"MIT"
] | 5 | 2019-03-20T20:25:04.000Z | 2020-11-11T18:10:46.000Z | from .base import BaseComponent
| 29.184211 | 68 | 0.590622 | from .base import BaseComponent
class KojiBuilder(BaseComponent):
componentName = "koji_builder"
deploymentConfigName = "koji-builder"
def create_build(self):
self.state.apply_object_from_template(
"general/imagestream.yml",
imagename="koji-builder",
)
self... | 910 | 143 | 23 |
ca09d8932c3db970f5ab8fc70711f85e9139a9a0 | 785 | py | Python | Modules/Module5/SampleCode/9_infinite_loops.py | hackettccp/CSCI111 | 129b2120dbedb54e7964b9d915e2457962cf55e2 | [
"MIT"
] | 2 | 2019-10-23T03:25:37.000Z | 2021-02-23T04:09:03.000Z | Modules/Module5/SampleCode/9_infinite_loops.py | hackettccp/CSCI111 | 129b2120dbedb54e7964b9d915e2457962cf55e2 | [
"MIT"
] | null | null | null | Modules/Module5/SampleCode/9_infinite_loops.py | hackettccp/CSCI111 | 129b2120dbedb54e7964b9d915e2457962cf55e2 | [
"MIT"
] | null | null | null | """
This program demonstrates an infinite loop.
This program will need to be force closed as it will never end.
"""
keep_going = "y" #Variable to control the loop.
#Warning! Infinite loop! This program will never end.
while keep_going == "y":
sales = float(in... | 37.380952 | 119 | 0.611465 | """
This program demonstrates an infinite loop.
This program will need to be force closed as it will never end.
"""
keep_going = "y" #Variable to control the loop.
#Warning! Infinite loop! This program will never end.
while keep_going == "y":
sales = float(in... | 0 | 0 | 0 |
bf2c6e862a6db5373691e299e6ce5e966f8722d8 | 1,684 | py | Python | game/urls.py | iestynlee/Group-Software-Project | 407466b2cd6d332167904b8a628f64a769014b33 | [
"MIT"
] | 2 | 2022-02-28T15:50:43.000Z | 2022-03-02T17:38:18.000Z | game/urls.py | iestynlee/Group-Software-Project | 407466b2cd6d332167904b8a628f64a769014b33 | [
"MIT"
] | null | null | null | game/urls.py | iestynlee/Group-Software-Project | 407466b2cd6d332167904b8a628f64a769014b33 | [
"MIT"
] | 3 | 2022-03-01T12:37:25.000Z | 2022-03-24T00:53:50.000Z | from django.urls import path, include
from . import views
from django.contrib.auth import views as auth_views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
app_name='game'
urlpatterns = [
#Home
path('', views.home, name="home"),
#Lobby
path('lobbies/', views.lobbies, name="lobbi... | 44.315789 | 161 | 0.752969 | from django.urls import path, include
from . import views
from django.contrib.auth import views as auth_views
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
app_name='game'
urlpatterns = [
#Home
path('', views.home, name="home"),
#Lobby
path('lobbies/', views.lobbies, name="lobbi... | 0 | 0 | 0 |
9a853999efff9cee4e89a3cc226b86bb0add20a0 | 975 | py | Python | python/pygtk/python_gtk3_pygobject/container_box_vertical.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 23 | 2015-06-08T13:01:00.000Z | 2021-12-30T08:20:04.000Z | python/pygtk/python_gtk3_pygobject/container_box_vertical.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 1 | 2020-10-22T02:36:10.000Z | 2020-10-22T02:36:10.000Z | python/pygtk/python_gtk3_pygobject/container_box_vertical.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 7 | 2017-10-31T09:48:14.000Z | 2022-01-04T15:59:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
This is the simplest Python GTK+3 snippet.
See: http://python-gtk-3-tutorial.readthedocs.org/en/latest/layout.html
"""
from gi.repository import Gtk as gtk
if __name__ == '__main__':
main()
| 29.545455 | 118 | 0.653333 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
This is the simplest Python GTK+3 snippet.
See: http://python-gtk-3-tutorial.readthedocs.org/en/latest/layout.html
"""
from gi.repository import Gtk as gtk
def main():
window = gtk.Window()
vertica... | 643 | 0 | 23 |
fdb25ace37b7d268698883213869a3b6293a3ed7 | 209 | py | Python | lite/jupyterlite-pidgy/py_src/jupyterlite_pidgy/_version.py | deathbeds/pidgy | 0162157a4c35f2053b4fc774a4c67cfc0d2c7df5 | [
"BSD-3-Clause"
] | 25 | 2020-03-02T15:34:12.000Z | 2022-01-22T11:10:32.000Z | lite/jupyterlite-pidgy/py_src/jupyterlite_pidgy/_version.py | deathbeds/pidgy | 0162157a4c35f2053b4fc774a4c67cfc0d2c7df5 | [
"BSD-3-Clause"
] | 26 | 2020-02-21T14:39:11.000Z | 2021-12-14T02:28:51.000Z | lite/jupyterlite-pidgy/py_src/jupyterlite_pidgy/_version.py | deathbeds/rites | 0162157a4c35f2053b4fc774a4c67cfc0d2c7df5 | [
"BSD-3-Clause"
] | 4 | 2020-02-19T00:13:22.000Z | 2021-12-01T23:13:07.000Z | import json
from pathlib import Path
__all__ = ["__version__", "__js__"]
__js__ = json.load(
(Path(__file__).parent.resolve() / "labextension/package.json").read_bytes()
)
__version__ = __js__["version"]
| 23.222222 | 80 | 0.722488 | import json
from pathlib import Path
__all__ = ["__version__", "__js__"]
__js__ = json.load(
(Path(__file__).parent.resolve() / "labextension/package.json").read_bytes()
)
__version__ = __js__["version"]
| 0 | 0 | 0 |
1682c4c66064dc8bc79dcf51f150e33acf9b24cb | 3,589 | py | Python | ooobuild/lo/sheet/data_pilot_field_group_by.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/sheet/data_pilot_field_group_by.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/sheet/data_pilot_field_group_by.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 43.768293 | 244 | 0.711062 | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 0 | 0 | 0 |
d4234d5ad14e3ee2b8f36f9a017c1291d66f6bdd | 1,149 | py | Python | chinese_permanent_calendar/perpetual_calendar.py | demeen68/chinese_permanent_calendar | 4c0e48baaf40ba7f8368943e4d10d0cce4e14e43 | [
"MIT"
] | 3 | 2021-08-13T04:02:24.000Z | 2022-02-19T07:43:42.000Z | chinese_permanent_calendar/perpetual_calendar.py | demeen68/chinese_permanent_calendar | 4c0e48baaf40ba7f8368943e4d10d0cce4e14e43 | [
"MIT"
] | null | null | null | chinese_permanent_calendar/perpetual_calendar.py | demeen68/chinese_permanent_calendar | 4c0e48baaf40ba7f8368943e4d10d0cce4e14e43 | [
"MIT"
] | 2 | 2021-12-31T08:05:43.000Z | 2022-02-19T07:43:56.000Z | # -*- coding: utf-8 -*-
import pandas as pd
| 41.035714 | 118 | 0.612707 | # -*- coding: utf-8 -*-
import pandas as pd
class PerpetualCalendar(object):
def __init__(self):
import os.path
file_path = os.path.abspath(os.path.dirname(__file__))
# self.calendar: pd.DataFrame = pd.read_pickle(file_path + '/cp_calendar.pkl') # This is a data file
self.calendar... | 1,031 | 11 | 76 |
ef44df7b49331dc09eccb90464c70cb81c89b14d | 949 | py | Python | code/python/MarketIntelligence/v1/fds/sdk/MarketIntelligence/models/__init__.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/MarketIntelligence/v1/fds/sdk/MarketIntelligence/models/__init__.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/MarketIntelligence/v1/fds/sdk/MarketIntelligence/models/__init__.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
# import all models into this package
# if you have many models here with many references from one model to another this may
# raise a RecursionError
# to avoid this, import only the models that you directly need like:
# from from fds.sdk.MarketIntelligence.model.pet import Pet
# or import this package,... | 49.947368 | 86 | 0.847208 | # flake8: noqa
# import all models into this package
# if you have many models here with many references from one model to another this may
# raise a RecursionError
# to avoid this, import only the models that you directly need like:
# from from fds.sdk.MarketIntelligence.model.pet import Pet
# or import this package,... | 0 | 0 | 0 |
b1795b0025443f4846db24deca6027a3f4a3d80e | 2,037 | py | Python | 58_ML_06_03_what_is_gabor_filter.py | Data-Laboratory/WorkExamples | 27e58207e664da7813673e6792c0c30c0a5bf74c | [
"MIT"
] | 1 | 2021-12-15T22:27:27.000Z | 2021-12-15T22:27:27.000Z | 58_ML_06_03_what_is_gabor_filter.py | Data-Laboratory/WorkExamples | 27e58207e664da7813673e6792c0c30c0a5bf74c | [
"MIT"
] | null | null | null | 58_ML_06_03_what_is_gabor_filter.py | Data-Laboratory/WorkExamples | 27e58207e664da7813673e6792c0c30c0a5bf74c | [
"MIT"
] | null | null | null |
"""
#Ref: Sreenivas Sarwar Anik
What are features?
s
"""
##############################################
#Gabor filter, multiple filters in one. Generate fiter bank.
"""
For image processing and computer vision, Gabor filters are generally
used in texture analysis, edge detection, feature extraction, etc.
Gabor f... | 31.828125 | 94 | 0.730977 |
"""
#Ref: Sreenivas Sarwar Anik
What are features?
s
"""
##############################################
#Gabor filter, multiple filters in one. Generate fiter bank.
"""
For image processing and computer vision, Gabor filters are generally
used in texture analysis, edge detection, feature extraction, etc.
Gabor f... | 0 | 0 | 0 |
f3c9e8d2d36667631a4a275e26bf61f10b652a35 | 3,222 | py | Python | src/testutils.py | joaosoares/xray_teeth_detection | 2385038e1fa609988eb2dfef11c0fff04815b23f | [
"MIT"
] | 3 | 2018-08-16T11:52:53.000Z | 2021-05-18T13:12:44.000Z | src/testutils.py | joaosoares/xray_teeth_detection | 2385038e1fa609988eb2dfef11c0fff04815b23f | [
"MIT"
] | null | null | null | src/testutils.py | joaosoares/xray_teeth_detection | 2385038e1fa609988eb2dfef11c0fff04815b23f | [
"MIT"
] | null | null | null | """Assorted utilities for tests"""
import unittest
from typing import Tuple, List
import cv2
import numpy as np
import numpy.testing as npt
from active_shape_model import ActiveShapeModel
from image_shape import ImageShape
from imgutils import load_images, apply_median_blur, apply_sobel
from incisors import Incisors
... | 33.216495 | 86 | 0.656425 | """Assorted utilities for tests"""
import unittest
from typing import Tuple, List
import cv2
import numpy as np
import numpy.testing as npt
from active_shape_model import ActiveShapeModel
from image_shape import ImageShape
from imgutils import load_images, apply_median_blur, apply_sobel
from incisors import Incisors
... | 1,331 | 1 | 145 |
8bbe1ceec1cbf6f7a93b4bc83fe8b9015a1d6f82 | 3,444 | py | Python | experiments/dtm.py | SebastianBruijns/pgmult | b727e31f58474c53d6cbf3abf6823db3b2bb4797 | [
"MIT"
] | 58 | 2015-06-22T15:07:17.000Z | 2022-03-08T20:27:22.000Z | experiments/dtm.py | afcarl/pgmult | 60631edda247486532b3269d0954b91bad7b8159 | [
"MIT"
] | 13 | 2015-06-22T15:00:53.000Z | 2017-10-05T23:58:41.000Z | experiments/dtm.py | afcarl/pgmult | 60631edda247486532b3269d0954b91bad7b8159 | [
"MIT"
] | 25 | 2015-07-07T16:31:42.000Z | 2021-12-28T11:25:34.000Z |
import numpy as np
import time
import re
import os
import operator
import pickle as pickle
import dateutil
from urllib.request import urlopen
from collections import namedtuple
from pybasicbayes.util.text import progprint, progprint_xrange
from pgmult.utils import mkdir
from ctm import get_sparse_repr, split_test_tr... | 27.774194 | 94 | 0.633566 |
import numpy as np
import time
import re
import os
import operator
import pickle as pickle
import dateutil
from urllib.request import urlopen
from collections import namedtuple
from pybasicbayes.util.text import progprint, progprint_xrange
from pgmult.utils import mkdir
from ctm import get_sparse_repr, split_test_tr... | 1,970 | 0 | 92 |
311087fa4c6071535a9bd352280816d5c2fff401 | 1,838 | py | Python | vortex_auth/config.py | sihrc/vortex-auth | 729701628b4e7e446ac86bbc85640e9c997b869f | [
"MIT"
] | null | null | null | vortex_auth/config.py | sihrc/vortex-auth | 729701628b4e7e446ac86bbc85640e9c997b869f | [
"MIT"
] | null | null | null | vortex_auth/config.py | sihrc/vortex-auth | 729701628b4e7e446ac86bbc85640e9c997b869f | [
"MIT"
] | null | null | null | import logging
from vortex.errors import VortexException
| 33.418182 | 88 | 0.767138 | import logging
from vortex.errors import VortexException
class Configuration(object):
configured = False
logger = logging.getLogger("vortex.auth")
exc_cls = VortexException
audience = ["vortex:base"]
auth_cookie_name = "auth_token"
cookie_domain = None
auth_token_secret = None
secure_... | 1,421 | 288 | 69 |
6f6292ee7214698ea0cbf76fc3db39a2717f320b | 369 | py | Python | server/rest/migrations/0002_room_root.py | nking1232/html5-msoy | 6e026f1989b15310ad67c050beb69a168c3bdd5f | [
"MIT"
] | null | null | null | server/rest/migrations/0002_room_root.py | nking1232/html5-msoy | 6e026f1989b15310ad67c050beb69a168c3bdd5f | [
"MIT"
] | null | null | null | server/rest/migrations/0002_room_root.py | nking1232/html5-msoy | 6e026f1989b15310ad67c050beb69a168c3bdd5f | [
"MIT"
] | 2 | 2020-12-18T19:19:38.000Z | 2020-12-18T19:53:56.000Z | # Generated by Django 3.1.3 on 2020-12-01 19:08
from django.db import migrations, models
| 19.421053 | 53 | 0.579946 | # Generated by Django 3.1.3 on 2020-12-01 19:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rest', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='room',
name='root',
field=mode... | 0 | 255 | 23 |
48e6eff338b268a8d4651fe7edcdfa2ef3210901 | 1,317 | py | Python | runtests.py | abdulwahed-mansour/django-ajax-datatable | d992814d6c71d0578d3d1fd24ce994f13ea364a6 | [
"MIT"
] | 1 | 2021-01-18T11:26:17.000Z | 2021-01-18T11:26:17.000Z | runtests.py | abdulwahed-mansour/django-ajax-datatable | d992814d6c71d0578d3d1fd24ce994f13ea364a6 | [
"MIT"
] | null | null | null | runtests.py | abdulwahed-mansour/django-ajax-datatable | d992814d6c71d0578d3d1fd24ce994f13ea364a6 | [
"MIT"
] | 1 | 2021-02-04T16:20:02.000Z | 2021-02-04T16:20:02.000Z | #!/usr/bin/env python
import os
import sys
# See "Using the Django test runner to test reusable applications":
# https://docs.djangoproject.com/en/3.1/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications
import django
from django.conf import settings
from django.test.utils import get_ru... | 27.4375 | 123 | 0.709188 | #!/usr/bin/env python
import os
import sys
# See "Using the Django test runner to test reusable applications":
# https://docs.djangoproject.com/en/3.1/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications
import django
from django.conf import settings
from django.test.utils import get_ru... | 0 | 0 | 0 |
a99246d96f25335211afb9a462efaa43868a7cbe | 13,316 | py | Python | Python/n_puzzle_astar.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 1,428 | 2018-10-03T15:15:17.000Z | 2019-03-31T18:38:36.000Z | Python/n_puzzle_astar.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 1,162 | 2018-10-03T15:05:49.000Z | 2018-10-18T14:17:52.000Z | Python/n_puzzle_astar.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 3,909 | 2018-10-03T15:07:19.000Z | 2019-03-31T18:39:08.000Z | from collections import defaultdict
import time
import numpy as np
import os
from math import ceil
class MinHeap:
"""
Implementation of Min Heap data structure
"""
def create_min_heap(self, arr):
"""
Converts a given array into a min heap
:param arr: input array of numbers
... | 31.11215 | 108 | 0.577576 | from collections import defaultdict
import time
import numpy as np
import os
from math import ceil
class MinHeap:
"""
Implementation of Min Heap data structure
"""
def __init__(self, arr=None):
self.heap = []
self.heap_size = 0
if arr is not None:
self.create_min_he... | 730 | 0 | 79 |
fd74713bbfd8b4b2ece73674fdd3caaeb4764056 | 729 | py | Python | tests/test_math.py | TheWeiHu/dsa_python | a5c3f5a983c88d9a49d431d24674057cc6beca51 | [
"MIT"
] | null | null | null | tests/test_math.py | TheWeiHu/dsa_python | a5c3f5a983c88d9a49d431d24674057cc6beca51 | [
"MIT"
] | null | null | null | tests/test_math.py | TheWeiHu/dsa_python | a5c3f5a983c88d9a49d431d24674057cc6beca51 | [
"MIT"
] | null | null | null | """test fibonacci alogrithms"""
from src.math import class_memoization_fibonacci
from src.math import explicit_fibonacci
from src.math import function_memoization_fibonacci
from src.math import iterative_fibonacci
from src.math import recursive_fibonacci
def test_fibonacci():
"""test fibonacci algorithms"""
t... | 30.375 | 63 | 0.702332 | """test fibonacci alogrithms"""
from src.math import class_memoization_fibonacci
from src.math import explicit_fibonacci
from src.math import function_memoization_fibonacci
from src.math import iterative_fibonacci
from src.math import recursive_fibonacci
def test_fibonacci():
"""test fibonacci algorithms"""
t... | 0 | 0 | 0 |
9e259388df5a5072b0af282c6d7f690e8a25f8c5 | 1,189 | py | Python | agant/models/keras/discriminator/cgan.py | Sinha-Raunak/gan-toolkit | 6d2d86833bb00833b2d9cd11a1a83476f44b65fd | [
"MIT"
] | null | null | null | agant/models/keras/discriminator/cgan.py | Sinha-Raunak/gan-toolkit | 6d2d86833bb00833b2d9cd11a1a83476f44b65fd | [
"MIT"
] | null | null | null | agant/models/keras/discriminator/cgan.py | Sinha-Raunak/gan-toolkit | 6d2d86833bb00833b2d9cd11a1a83476f44b65fd | [
"MIT"
] | null | null | null | from keras.models import Sequential, Model
from keras.layers import Input, Dense, Reshape, Flatten, Dropout,multiply
from keras.layers.advanced_activations import LeakyReLU
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
import numpy as np | 36.030303 | 140 | 0.719092 | from keras.models import Sequential, Model
from keras.layers import Input, Dense, Reshape, Flatten, Dropout,multiply
from keras.layers.advanced_activations import LeakyReLU
from keras.layers import BatchNormalization, Activation, Embedding, ZeroPadding2D
import numpy as np
def Discriminator(conf_data):
img_shape ... | 892 | 0 | 23 |
ecef6524da82399598b05bb46cff52a1a61d056e | 4,634 | py | Python | ares/main.py | lleon95/NanoSciTracker-Python | f682c1f3b9b9f76a6de8ea816df910715539edf1 | [
"Apache-2.0"
] | null | null | null | ares/main.py | lleon95/NanoSciTracker-Python | f682c1f3b9b9f76a6de8ea816df910715539edf1 | [
"Apache-2.0"
] | null | null | null | ares/main.py | lleon95/NanoSciTracker-Python | f682c1f3b9b9f76a6de8ea816df910715539edf1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# NanoSciTracker - 2020
# Author: Luis G. Leon Vega <luis@luisleon.me>
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF li... | 31.52381 | 88 | 0.679111 | #!/usr/bin/env python3
# NanoSciTracker - 2020
# Author: Luis G. Leon Vega <luis@luisleon.me>
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF li... | 1,970 | 0 | 23 |
60dac1879b51e43b8d207b19810a23904b744d7d | 987 | py | Python | main.py | Ethan-source/01-Introduction | dd94a73c6cd51177e9fb82d90eddb5df5777acff | [
"MIT"
] | null | null | null | main.py | Ethan-source/01-Introduction | dd94a73c6cd51177e9fb82d90eddb5df5777acff | [
"MIT"
] | null | null | null | main.py | Ethan-source/01-Introduction | dd94a73c6cd51177e9fb82d90eddb5df5777acff | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import utils
utils.check_version((3,7))
utils.clear()
print('Hello, my name is Ethan Yee, I am a sophomore Digital & Interactive Media major from Chicago, IL.')
print('My favorite video game is Super Smash Bros Ultimate for the Nintendo switch. The task of the game seems so simple, knock your... | 54.833333 | 303 | 0.77305 | #!/usr/bin/env python3
import utils
utils.check_version((3,7))
utils.clear()
print('Hello, my name is Ethan Yee, I am a sophomore Digital & Interactive Media major from Chicago, IL.')
print('My favorite video game is Super Smash Bros Ultimate for the Nintendo switch. The task of the game seems so simple, knock your... | 0 | 0 | 0 |
e45d3322b58e477e1fe3eaca22721c8faf4b0a4c | 1,479 | py | Python | pycpptool/get_tu.py | ousttrue/pycpptool | f2830deb00cec1e40ff2454d328a9d8fcf2f6319 | [
"MIT"
] | 1 | 2019-04-12T11:45:39.000Z | 2019-04-12T11:45:39.000Z | pycpptool/get_tu.py | ousttrue/pycpptool | f2830deb00cec1e40ff2454d328a9d8fcf2f6319 | [
"MIT"
] | null | null | null | pycpptool/get_tu.py | ousttrue/pycpptool | f2830deb00cec1e40ff2454d328a9d8fcf2f6319 | [
"MIT"
] | null | null | null | import pathlib
from typing import List, Optional
from clang import cindex
# helper {{{
DEFAULT_CLANG_DLL = pathlib.Path("C:/Program Files/LLVM/bin/libclang.dll")
SET_DLL = False
def get_tu(path: pathlib.Path,
include_path_list: List[pathlib.Path] = None,
use_macro: bool = False,
... | 27.90566 | 80 | 0.602434 | import pathlib
from typing import List, Optional
from clang import cindex
# helper {{{
DEFAULT_CLANG_DLL = pathlib.Path("C:/Program Files/LLVM/bin/libclang.dll")
SET_DLL = False
def get_tu(path: pathlib.Path,
include_path_list: List[pathlib.Path] = None,
use_macro: bool = False,
... | 0 | 0 | 0 |
879a7e0091cbd814b8fb351ae61e889c6765d8a9 | 2,060 | py | Python | tests/container/test_container.py | ThirVondukr/aioinject | 0415c5efe0f619758cc3cb6a07397be8d38b8365 | [
"MIT"
] | null | null | null | tests/container/test_container.py | ThirVondukr/aioinject | 0415c5efe0f619758cc3cb6a07397be8d38b8365 | [
"MIT"
] | null | null | null | tests/container/test_container.py | ThirVondukr/aioinject | 0415c5efe0f619758cc3cb6a07397be8d38b8365 | [
"MIT"
] | null | null | null | import pytest
from aioinject import providers
from aioinject.containers import Container
from aioinject.context import InjectionContext
@pytest.fixture
@pytest.fixture
| 24.819277 | 77 | 0.783981 | import pytest
from aioinject import providers
from aioinject.containers import Container
from aioinject.context import InjectionContext
class _AbstractService:
pass
class _ServiceA(_AbstractService):
pass
class _ServiceB(_AbstractService):
pass
@pytest.fixture
def container() -> Container:
retu... | 1,524 | 55 | 297 |
8f9ab3691f5fef8e16b6b36aaa11c2983a7e7f33 | 7,260 | py | Python | ingenico/connect/sdk/domain/hostedcheckout/definitions/mobile_payment_method_specific_input_hosted_checkout.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 12 | 2016-09-26T21:46:31.000Z | 2020-12-23T18:44:54.000Z | ingenico/connect/sdk/domain/hostedcheckout/definitions/mobile_payment_method_specific_input_hosted_checkout.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 3 | 2020-05-02T16:53:02.000Z | 2020-06-02T12:49:51.000Z | ingenico/connect/sdk/domain/hostedcheckout/definitions/mobile_payment_method_specific_input_hosted_checkout.py | festicket/connect-sdk-python3 | c399c6443789dd978f319c89e1ebd387c812a77b | [
"MIT"
] | 11 | 2017-07-16T00:55:28.000Z | 2021-09-24T17:00:49.000Z | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.domain.definitions.abstract_payment_method_specific_input import AbstractPaymentMethodSpecificInput
from ingenico.connect.sdk.domain.hostedchec... | 50.068966 | 240 | 0.736915 | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.domain.definitions.abstract_payment_method_specific_input import AbstractPaymentMethodSpecificInput
from ingenico.connect.sdk.domain.hostedchec... | 2,854 | 3,755 | 23 |
06071992576136b87ee0e6850d0bc283356d19f3 | 214 | py | Python | Exercicios7/exercicio3.py | vinihf/Prog1_ADS_2019 | 97d2e0cddf72c00a73d0bc3070bb9731e66e19e2 | [
"CC-BY-4.0"
] | 1 | 2019-04-18T13:43:15.000Z | 2019-04-18T13:43:15.000Z | Exercicios7/exercicio3.py | vinihf/Prog1_ADS_2019 | 97d2e0cddf72c00a73d0bc3070bb9731e66e19e2 | [
"CC-BY-4.0"
] | null | null | null | Exercicios7/exercicio3.py | vinihf/Prog1_ADS_2019 | 97d2e0cddf72c00a73d0bc3070bb9731e66e19e2 | [
"CC-BY-4.0"
] | null | null | null |
nome = input("Informe o seu nome:")
print(quantosAs(nome)) | 19.454545 | 35 | 0.584112 | def quantosAs(nome):
contador = 0
nome = nome.lower()
for letra in nome:
if letra == 'a':
contador+=1
return contador
nome = input("Informe o seu nome:")
print(quantosAs(nome)) | 132 | 0 | 22 |
6c6c6ef7c15ff83289ff3d078cf2112d7078d67a | 1,553 | py | Python | rlberry/spaces/discrete.py | riccardodv/rlberry | 8bb03772cda1e13c57de0e1da7bc7356a3014cfb | [
"MIT"
] | 86 | 2020-11-20T21:02:27.000Z | 2022-03-07T14:57:40.000Z | rlberry/spaces/discrete.py | riccardodv/rlberry | 8bb03772cda1e13c57de0e1da7bc7356a3014cfb | [
"MIT"
] | 103 | 2020-11-17T12:31:21.000Z | 2022-03-28T13:46:16.000Z | rlberry/spaces/discrete.py | riccardodv/rlberry | 8bb03772cda1e13c57de0e1da7bc7356a3014cfb | [
"MIT"
] | 20 | 2020-11-23T01:47:50.000Z | 2022-03-25T07:45:24.000Z | import gym
from rlberry.seeding import Seeder
class Discrete(gym.spaces.Discrete):
"""
Class that represents discrete spaces.
Inherited from gym.spaces.Discrete for compatibility with gym.
rlberry wraps gym.spaces to make sure the seeding
mechanism is unified in the library (rlberry.seeding)
... | 25.459016 | 88 | 0.600129 | import gym
from rlberry.seeding import Seeder
class Discrete(gym.spaces.Discrete):
"""
Class that represents discrete spaces.
Inherited from gym.spaces.Discrete for compatibility with gym.
rlberry wraps gym.spaces to make sure the seeding
mechanism is unified in the library (rlberry.seeding)
... | 137 | 0 | 80 |
a01ca5a759b3bb8a0eeea2cc022c1c5667c5c739 | 1,520 | py | Python | test/z_manual_load.py | DXCyber409/AndroidNativeEmulator | 11a0360a947114375757724eecd9bd9dbca43a56 | [
"Apache-2.0"
] | 3 | 2020-05-21T09:15:11.000Z | 2022-01-12T13:52:20.000Z | test/z_manual_load.py | DXCyber409/AndroidNativeEmulator | 11a0360a947114375757724eecd9bd9dbca43a56 | [
"Apache-2.0"
] | null | null | null | test/z_manual_load.py | DXCyber409/AndroidNativeEmulator | 11a0360a947114375757724eecd9bd9dbca43a56 | [
"Apache-2.0"
] | null | null | null | # 手动纯算法调用
import binascii
from unicorn import *
from unicorn.arm_const import *
from UnicornTraceDebugger import udbg
a1 = b'123'
mu = Uc(UC_ARCH_ARM, UC_MODE_THUMB)
#image
image_base = 0x0
image_size = 0x10000 * 8
mu.mem_map(image_base, image_size)
binary = open('jnilibs/libnative-lib.so','rb').read()
mu.mem_write... | 24.516129 | 88 | 0.727632 | # 手动纯算法调用
import binascii
from unicorn import *
from unicorn.arm_const import *
from UnicornTraceDebugger import udbg
def hook_code(uc, address, size, userdata):
print (">>> Tracing instruction at 0x%x, instruction size = 0x%x" % (address, size))
def hook_memory(uc, access, address, size,value, userdata):
... | 260 | 0 | 46 |
38d775edad676d8d924e4afe14c4d9bc782168ce | 366 | py | Python | RaspberryPi/DjangoSite/mysite/curling/functions.py | zbassett/curling-robot | 188800588fa294e93522ea20fa7ddab7b5a642b3 | [
"Apache-2.0"
] | 1 | 2017-10-04T13:41:36.000Z | 2017-10-04T13:41:36.000Z | RaspberryPi/DjangoSite/mysite/curling/functions.py | zbassett/curling-robot | 188800588fa294e93522ea20fa7ddab7b5a642b3 | [
"Apache-2.0"
] | null | null | null | RaspberryPi/DjangoSite/mysite/curling/functions.py | zbassett/curling-robot | 188800588fa294e93522ea20fa7ddab7b5a642b3 | [
"Apache-2.0"
] | null | null | null | from django.core import serializers
| 21.529412 | 140 | 0.718579 | from django.core import serializers
def DistanceCalc(PingTime,Temp,Humidity):
#Speed of sound (m/s)
SoS = 331.4 + (0.606 * float(Temp)) + (0.0124 * float(Humidity))
one_way_time = float(PingTime) / 1000000 / 2 #convert nanoseconds to seconds. divide by two since sound has to travel to and from the rock
distanc... | 302 | 0 | 23 |
2cc31a3b979058ca054c71ea7e175d34b73714f7 | 1,830 | py | Python | tests/test_tasks.py | SFDigitalServices/building-permits | 86ca54fa6e055231cbc0944d43996f6fc17daa6b | [
"MIT"
] | null | null | null | tests/test_tasks.py | SFDigitalServices/building-permits | 86ca54fa6e055231cbc0944d43996f6fc17daa6b | [
"MIT"
] | null | null | null | tests/test_tasks.py | SFDigitalServices/building-permits | 86ca54fa6e055231cbc0944d43996f6fc17daa6b | [
"MIT"
] | null | null | null | """ tests for celery tasks """
from unittest.mock import patch, Mock
import requests
import tests.mocks as mocks
from tasks import scheduler
@patch('tasks.requests.post')
@patch('service.resources.applications.requests.get')
def test_scheduler(mock_query_get, mock_bluebeam_post, mock_env_access_key):
# pylint: dis... | 37.346939 | 97 | 0.765027 | """ tests for celery tasks """
from unittest.mock import patch, Mock
import requests
import tests.mocks as mocks
from tasks import scheduler
@patch('tasks.requests.post')
@patch('service.resources.applications.requests.get')
def test_scheduler(mock_query_get, mock_bluebeam_post, mock_env_access_key):
# pylint: dis... | 0 | 0 | 0 |
872b5a4b068cff55964c62fb9bccc1a282e06b28 | 1,590 | py | Python | api/staticdata/control_list_entries/parser.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | null | null | null | api/staticdata/control_list_entries/parser.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | null | null | null | api/staticdata/control_list_entries/parser.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | null | null | null | from django.conf import settings
from api.staticdata.control_list_entries.models import ControlListEntry
| 36.976744 | 113 | 0.606918 | from django.conf import settings
from api.staticdata.control_list_entries.models import ControlListEntry
def parse_list_into_control_list_entries(worksheet):
if not settings.SUPPRESS_TEST_OUTPUT:
print(f"Seeding {worksheet.title}...")
parents_at_depth = [None, None, None, None, None, None, None, None... | 1,461 | 0 | 23 |
72593a9479b33c2b056a28819c46fff68822b7a5 | 1,697 | py | Python | beacon/endpoints/rest/handlers.py | elixir-luxembourg/BH2020-beacon-2.x | fc68c70e06e3d928bcca7e5d99cd740154314be4 | [
"Apache-2.0"
] | 1 | 2021-11-09T08:38:06.000Z | 2021-11-09T08:38:06.000Z | beacon/endpoints/rest/handlers.py | elixir-luxembourg/BH2020-beacon-2.x | fc68c70e06e3d928bcca7e5d99cd740154314be4 | [
"Apache-2.0"
] | null | null | null | beacon/endpoints/rest/handlers.py | elixir-luxembourg/BH2020-beacon-2.x | fc68c70e06e3d928bcca7e5d99cd740154314be4 | [
"Apache-2.0"
] | null | null | null | from ...utils import db
from .response.response_schema import (build_variant_response,
build_biosample_or_individual_response)
from . import BiosamplesParameters, GVariantsParameters, IndividualsParameters, generic_handler
biosamples_proxy = BiosamplesParameters()
gvariants_proxy... | 80.809524 | 153 | 0.850324 | from ...utils import db
from .response.response_schema import (build_variant_response,
build_biosample_or_individual_response)
from . import BiosamplesParameters, GVariantsParameters, IndividualsParameters, generic_handler
biosamples_proxy = BiosamplesParameters()
gvariants_proxy... | 0 | 0 | 0 |
775e56620bd1f1c0edda004c4fba5aef71cde6a2 | 8,911 | py | Python | official/projects/edgetpu/vision/modeling/mobilenet_edgetpu_v1_model_test.py | KiryanovKD/models | e17080247e3c9b3301680f61b8f4815c22509e7e | [
"Apache-2.0"
] | 4 | 2019-11-02T14:47:46.000Z | 2022-01-14T10:43:02.000Z | official/projects/edgetpu/vision/modeling/mobilenet_edgetpu_v1_model_test.py | KiryanovKD/models | e17080247e3c9b3301680f61b8f4815c22509e7e | [
"Apache-2.0"
] | 6 | 2021-10-05T18:53:55.000Z | 2022-03-29T21:37:00.000Z | official/projects/edgetpu/vision/modeling/mobilenet_edgetpu_v1_model_test.py | KiryanovKD/models | e17080247e3c9b3301680f61b8f4815c22509e7e | [
"Apache-2.0"
] | 2 | 2021-11-30T21:50:03.000Z | 2022-03-27T01:27:31.000Z | # Copyright 2021 The TensorFlow 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
#
# Unless required by applica... | 33.753788 | 87 | 0.686567 | # Copyright 2021 The TensorFlow 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
#
# Unless required by applica... | 2,217 | 4,728 | 244 |
f063de2f719cb7375f829a10db95f778f9dc793b | 3,259 | py | Python | api/app/views.py | jmsv/hackthemidlands18 | 5d832047af62fdeefbcfc7c07f408fb782c42954 | [
"MIT"
] | null | null | null | api/app/views.py | jmsv/hackthemidlands18 | 5d832047af62fdeefbcfc7c07f408fb782c42954 | [
"MIT"
] | null | null | null | api/app/views.py | jmsv/hackthemidlands18 | 5d832047af62fdeefbcfc7c07f408fb782c42954 | [
"MIT"
] | null | null | null | from flask import Flask, request
import json
from flask_cors import CORS
from app import utils, job
from . import app, redis_store
import threading
CORS(app)
# Activate the siege weapon...
# No turning back now.
@app.route('/api/enable', methods=['POST'])
# Two factor
@app.route('/api/getCode')
@app.route('/ap... | 24.689394 | 71 | 0.543418 | from flask import Flask, request
import json
from flask_cors import CORS
from app import utils, job
from . import app, redis_store
import threading
CORS(app)
# Activate the siege weapon...
# No turning back now.
@app.route('/api/enable', methods=['POST'])
def enable():
body = request.get_json()
# Validate t... | 2,646 | 0 | 110 |
5e41ee0a08e0b39183f62951fddef3dce95e3cb5 | 3,544 | py | Python | thomas/core/learn/structure/greedy.py | mellesies/thomas-core | fb565334321c207d7870ed5c29eee8f8a8aac382 | [
"MIT"
] | null | null | null | thomas/core/learn/structure/greedy.py | mellesies/thomas-core | fb565334321c207d7870ed5c29eee8f8a8aac382 | [
"MIT"
] | 4 | 2020-03-03T16:36:45.000Z | 2021-06-15T18:08:06.000Z | thomas/core/learn/structure/greedy.py | mellesies/py-bn | fb565334321c207d7870ed5c29eee8f8a8aac382 | [
"MIT"
] | 1 | 2020-12-08T09:25:53.000Z | 2020-12-08T09:25:53.000Z | """Functions for learning the structure of a bayesian network from an input dataset"""
import numpy as np
from collections import namedtuple
from itertools import combinations
from sklearn.metrics import mutual_info_score
from ...factors import Factor
from ...factors import CPT
def greedy_network_learning(df, degre... | 36.916667 | 110 | 0.691309 | """Functions for learning the structure of a bayesian network from an input dataset"""
import numpy as np
from collections import namedtuple
from itertools import combinations
from sklearn.metrics import mutual_info_score
from ...factors import Factor
from ...factors import CPT
def greedy_network_learning(df, degre... | 385 | 0 | 23 |
00dfb1a8b1a923311a9cd4e0617dc05fd973bb4c | 6,316 | py | Python | patient/api.py | project-sabai/Sabai-Backend | fbc25d6ec774900d2602f6f8cf57544d873f401a | [
"MIT"
] | null | null | null | patient/api.py | project-sabai/Sabai-Backend | fbc25d6ec774900d2602f6f8cf57544d873f401a | [
"MIT"
] | 9 | 2020-06-05T22:10:47.000Z | 2021-06-10T18:38:13.000Z | patient/api.py | project-sabai/Sabai-Backend | fbc25d6ec774900d2602f6f8cf57544d873f401a | [
"MIT"
] | 1 | 2019-09-01T04:41:58.000Z | 2019-09-01T04:41:58.000Z | from django.core import serializers
from django.core.exceptions import ObjectDoesNotExist
from django.db import DataError
from django.http import JsonResponse, HttpResponse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.decorators.csrf import csrf_exempt
from clinicmodels.models impor... | 39.72327 | 117 | 0.672419 | from django.core import serializers
from django.core.exceptions import ObjectDoesNotExist
from django.db import DataError
from django.http import JsonResponse, HttpResponse
from django.utils.datastructures import MultiValueDictKeyError
from django.views.decorators.csrf import csrf_exempt
from clinicmodels.models impor... | 168 | 0 | 22 |
67389140476492c565a25340edb6a01b9f0fe1ba | 5,619 | py | Python | kardioml/segmentation/teijeiro/knowledge/abstraction_patterns/rhythm/patterns.py | Seb-Good/physionet-challenge-2020 | c6f1648a148335babc0a26d8a589120616327548 | [
"BSD-2-Clause"
] | 13 | 2020-12-18T08:09:34.000Z | 2022-03-15T04:51:46.000Z | kardioml/segmentation/teijeiro/knowledge/abstraction_patterns/rhythm/patterns.py | Seb-Good/physionet-challenge-2020 | c6f1648a148335babc0a26d8a589120616327548 | [
"BSD-2-Clause"
] | null | null | null | kardioml/segmentation/teijeiro/knowledge/abstraction_patterns/rhythm/patterns.py | Seb-Good/physionet-challenge-2020 | c6f1648a148335babc0a26d8a589120616327548 | [
"BSD-2-Clause"
] | 14 | 2020-09-16T21:07:38.000Z | 2022-03-23T14:01:24.000Z | # -*- coding: utf-8 -*-
# pylint: disable-msg= E1002, E1101
"""
Created on Wed Nov 21 09:04:17 2012
This file contains the definition of a set of very simple abstraction patterns
in order to perform rhythm interpretation on an ECG signal.
@author: T. Teijeiro
"""
import kardioml.segmentation.teijeiro.knowledge.obser... | 36.251613 | 109 | 0.741413 | # -*- coding: utf-8 -*-
# pylint: disable-msg= E1002, E1101
"""
Created on Wed Nov 21 09:04:17 2012
This file contains the definition of a set of very simple abstraction patterns
in order to perform rhythm interpretation on an ECG signal.
@author: T. Teijeiro
"""
import kardioml.segmentation.teijeiro.knowledge.obser... | 0 | 0 | 0 |
d27d00ab2872f328b24b92f479a99a76388beada | 1,869 | py | Python | tests/Task/Image/UpdateImageMetadataTest.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 3 | 2018-05-28T20:56:19.000Z | 2018-06-02T15:58:10.000Z | tests/Task/Image/UpdateImageMetadataTest.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 2 | 2018-07-01T07:45:38.000Z | 2018-07-11T03:15:35.000Z | tests/Task/Image/UpdateImageMetadataTest.py | ramgopal99/centipede | 0b1dc1f17b025f6b37c9a3cf5753a46cbbcd36ba | [
"MIT"
] | 3 | 2018-07-10T14:51:13.000Z | 2022-03-17T00:39:58.000Z | import unittest
import os
from ...BaseTestCase import BaseTestCase
from centipede.Task import Task
from centipede.Crawler.Fs import FsPath
from centipede.Task.Fs.Checksum import ChecksumMatchError
from centipede.Task.Image import UpdateImageMetadata
class UpdateImageMetadataTest(BaseTestCase):
"""Test UpdateImageM... | 38.142857 | 107 | 0.712681 | import unittest
import os
from ...BaseTestCase import BaseTestCase
from centipede.Task import Task
from centipede.Crawler.Fs import FsPath
from centipede.Task.Fs.Checksum import ChecksumMatchError
from centipede.Task.Image import UpdateImageMetadata
class UpdateImageMetadataTest(BaseTestCase):
"""Test UpdateImageM... | 0 | 0 | 0 |
5e775ff9352c75ebb9bfcc3445697aadd9420b1b | 1,778 | py | Python | app.py | phorward/lark-ide | cdc98ea1c8684e1ef1be9a0fffd42ca90f02fd6e | [
"MIT"
] | 5 | 2020-06-05T16:04:00.000Z | 2020-08-09T18:03:29.000Z | app.py | phorward/lark-ide | cdc98ea1c8684e1ef1be9a0fffd42ca90f02fd6e | [
"MIT"
] | null | null | null | app.py | phorward/lark-ide | cdc98ea1c8684e1ef1be9a0fffd42ca90f02fd6e | [
"MIT"
] | 1 | 2021-02-27T09:56:02.000Z | 2021-02-27T09:56:02.000Z | from . import html5
from .examples import examples
from lark import Lark
from lark.tree import Tree
| 28.222222 | 131 | 0.679415 | from . import html5
from .examples import examples
from lark import Lark
from lark.tree import Tree
class App(html5.Div):
def __init__(self):
super().__init__("""
<h1>
<img src="lark-logo.png"> IDE
</h1>
<select [name]="examples">
<option disabled selected>Examples</option>
</select>
<s... | 1,582 | 0 | 94 |
deed963ac8c66cd48b75392f0d2281d3ae659e4d | 1,263 | py | Python | turtle_race.py | favanso/Python_Projects | b5be3d067f89abe27b15fb8b359ae8e96f45c52e | [
"MIT"
] | null | null | null | turtle_race.py | favanso/Python_Projects | b5be3d067f89abe27b15fb8b359ae8e96f45c52e | [
"MIT"
] | null | null | null | turtle_race.py | favanso/Python_Projects | b5be3d067f89abe27b15fb8b359ae8e96f45c52e | [
"MIT"
] | null | null | null | #Turtle Race Game
import turtle
import random
dice = [1,2,3,4,5,6]
turtle.title("Turtle Race")
turtle.setup(width=800, height=600)
#Setup turtles
playerone = turtle.Turtle()
playerone.color('blue')
playerone.shape('turtle')
playerone.penup()
playerone.goto(-200,100)
#setup second turtle
playert... | 20.370968 | 59 | 0.642122 | #Turtle Race Game
import turtle
import random
dice = [1,2,3,4,5,6]
turtle.title("Turtle Race")
turtle.setup(width=800, height=600)
#Setup turtles
playerone = turtle.Turtle()
playerone.color('blue')
playerone.shape('turtle')
playerone.penup()
playerone.goto(-200,100)
#setup second turtle
playert... | 0 | 0 | 0 |
6c76608d9232365e17a93893ef6372a3aee89803 | 2,818 | py | Python | patho/api/inference/infer_keras.py | vankhoa21991/patho_toolbox | 11489e958500505d501bcd11ea5c944d7629ea0f | [
"MIT"
] | null | null | null | patho/api/inference/infer_keras.py | vankhoa21991/patho_toolbox | 11489e958500505d501bcd11ea5c944d7629ea0f | [
"MIT"
] | null | null | null | patho/api/inference/infer_keras.py | vankhoa21991/patho_toolbox | 11489e958500505d501bcd11ea5c944d7629ea0f | [
"MIT"
] | null | null | null | from tqdm import tqdm
import tensorflow as tf
import numpy as np
import cv2
import glob
import gc
import rasterio
import pathlib
import pandas as pd
from rasterio.windows import Window
from tensorflow.keras.layers import *
from tensorflow.keras.applications import *
from tensorflow.keras.callbacks import *
from tensorf... | 36.128205 | 104 | 0.636622 | from tqdm import tqdm
import tensorflow as tf
import numpy as np
import cv2
import glob
import gc
import rasterio
import pathlib
import pandas as pd
from rasterio.windows import Window
from tensorflow.keras.layers import *
from tensorflow.keras.applications import *
from tensorflow.keras.callbacks import *
from tensorf... | 1,782 | 0 | 23 |
f1fdb7f7018966ae8a8075f24a1c62dd8765e1d0 | 286 | py | Python | units/Building.py | Ctalk3r/NotTowerDefence | c3b7cf890fdd07482a5fb47768033f1a9739ab53 | [
"MIT"
] | null | null | null | units/Building.py | Ctalk3r/NotTowerDefence | c3b7cf890fdd07482a5fb47768033f1a9739ab53 | [
"MIT"
] | null | null | null | units/Building.py | Ctalk3r/NotTowerDefence | c3b7cf890fdd07482a5fb47768033f1a9739ab53 | [
"MIT"
] | 1 | 2019-05-07T00:41:48.000Z | 2019-05-07T00:41:48.000Z | import pygame
from units.Unit import Unit
| 28.6 | 100 | 0.695804 | import pygame
from units.Unit import Unit
class Building(Unit):
def __init__(self, game_map, controller, hp, pos, width, height, name, unit_type, cost):
Unit.__init__(self, game_map, controller, hp, pos, width, height, "player", name, unit_type)
self.cost = cost
| 193 | 0 | 49 |
f557555ed59f27ec766c1007053532afb8400ffe | 1,886 | py | Python | nlp_uncertainty_ssl/predictors/cvt_tagger.py | apmoore1/nlp-uncertainty-ssl | 4531ffce61557b4d4a71b97698479a30f65efaec | [
"Apache-2.0"
] | null | null | null | nlp_uncertainty_ssl/predictors/cvt_tagger.py | apmoore1/nlp-uncertainty-ssl | 4531ffce61557b4d4a71b97698479a30f65efaec | [
"Apache-2.0"
] | null | null | null | nlp_uncertainty_ssl/predictors/cvt_tagger.py | apmoore1/nlp-uncertainty-ssl | 4531ffce61557b4d4a71b97698479a30f65efaec | [
"Apache-2.0"
] | null | null | null | from overrides import overrides
from allennlp.common.util import JsonDict
from allennlp.data import DatasetReader, Instance, Token
from allennlp.models import Model
from allennlp.predictors.predictor import Predictor
from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter
@Predictor.register('cvt-tagger'... | 40.12766 | 80 | 0.673913 | from overrides import overrides
from allennlp.common.util import JsonDict
from allennlp.data import DatasetReader, Instance, Token
from allennlp.models import Model
from allennlp.predictors.predictor import Predictor
from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter
@Predictor.register('cvt-tagger'... | 229 | 0 | 27 |
1cdf3da6ab43183c857416c8b9b55c1a8ecdde68 | 268 | py | Python | about/views.py | TechCentreUK/langs-bar | d6564922857c1ea333ef2ee1b271f1bff3d2ed4f | [
"W3C"
] | null | null | null | about/views.py | TechCentreUK/langs-bar | d6564922857c1ea333ef2ee1b271f1bff3d2ed4f | [
"W3C"
] | null | null | null | about/views.py | TechCentreUK/langs-bar | d6564922857c1ea333ef2ee1b271f1bff3d2ed4f | [
"W3C"
] | null | null | null | from django.shortcuts import render
def about(request):
""" A View to return the about.html """
return render(request, 'about/about.html')
def privacy(request):
""" A View to return the privacy.html """
return render(request, 'about/privacy.html')
| 22.333333 | 48 | 0.682836 | from django.shortcuts import render
def about(request):
""" A View to return the about.html """
return render(request, 'about/about.html')
def privacy(request):
""" A View to return the privacy.html """
return render(request, 'about/privacy.html')
| 0 | 0 | 0 |
445f8ff110084de9054f2d5526aaf400bf6e3608 | 3,999 | py | Python | lleaves/compiler/ast/scanner.py | chenglin/lleaves | 54e07cd39279a7f0407e3cc8adb5862b3bc41bda | [
"MIT"
] | 116 | 2021-06-25T14:33:26.000Z | 2022-03-30T07:32:29.000Z | lleaves/compiler/ast/scanner.py | chenglin/lleaves | 54e07cd39279a7f0407e3cc8adb5862b3bc41bda | [
"MIT"
] | 13 | 2021-07-28T07:12:40.000Z | 2022-03-30T05:59:10.000Z | lleaves/compiler/ast/scanner.py | chenglin/lleaves | 54e07cd39279a7f0407e3cc8adb5862b3bc41bda | [
"MIT"
] | 5 | 2021-06-28T16:44:49.000Z | 2022-03-23T02:40:21.000Z | """
The Scanner is responsible for iterating over the model.txt and transforming it into a more
usable representation.
It doesn't implement any transformations (expect for type casting).
"""
INPUT_SCAN_KEYS = {
"max_feature_idx": ScannedValue(int),
"num_class": ScannedValue(int),
"num_tree_per_iterati... | 31.488189 | 91 | 0.635159 | """
The Scanner is responsible for iterating over the model.txt and transforming it into a more
usable representation.
It doesn't implement any transformations (expect for type casting).
"""
def scan_model_file(file_path, general_info_only=False):
res = {"trees": []}
def read_blocks(file_path):
with ... | 1,651 | -2 | 118 |
148d72b1176a80e6a05dcbbc08f449832c192801 | 5,336 | py | Python | modules/IterativeHistogram.py | rlorigro/mungus | 2ff8d94f58b9f280399157912a999d5f31a459fd | [
"MIT"
] | null | null | null | modules/IterativeHistogram.py | rlorigro/mungus | 2ff8d94f58b9f280399157912a999d5f31a459fd | [
"MIT"
] | null | null | null | modules/IterativeHistogram.py | rlorigro/mungus | 2ff8d94f58b9f280399157912a999d5f31a459fd | [
"MIT"
] | null | null | null | import math
import numpy
if __name__ == "__main__":
# test the iterative histogram
iterative_histogram = IterativeHistogram(start=0, stop=10, n_bins=10)
iterative_histogram.update(0) # 1
iterative_histogram.update(-1) # None
iterative_histogram.update(10) # 10
it... | 38.666667 | 127 | 0.642241 | import math
import numpy
class IterativeHistogram:
def __init__(self, start, stop, n_bins, unbounded_upper_bin=False, unbounded_lower_bin=False, include_upper_edge=True):
self.start = start
self.stop = stop
self.n_bins = n_bins
self.histogram = numpy.zeros(n_bins)
... | 1,542 | 4 | 167 |
05e4a4c3252d52565fa5450accae686352f14997 | 761 | py | Python | phantom-rest-client/phantomAssets.py | jingalls/phantomrestclient | 317bdc1e7cc645cfecd33369d6c1716af738f7ea | [
"MIT"
] | null | null | null | phantom-rest-client/phantomAssets.py | jingalls/phantomrestclient | 317bdc1e7cc645cfecd33369d6c1716af738f7ea | [
"MIT"
] | null | null | null | phantom-rest-client/phantomAssets.py | jingalls/phantomrestclient | 317bdc1e7cc645cfecd33369d6c1716af738f7ea | [
"MIT"
] | null | null | null | import os
from basePhantom import _BasePhantom
class _PhantomAssets(_BasePhantom):
"""
Wrapper around the Phantom REST calls for Assets
"""
| 29.269231 | 61 | 0.672799 | import os
from basePhantom import _BasePhantom
class _PhantomAssets(_BasePhantom):
"""
Wrapper around the Phantom REST calls for Assets
"""
def __init__(self, host, username, password):
_BasePhantom.__init__(self, host, username, password)
self.endpoint_url = os.path.join(self.host, "a... | 500 | 0 | 107 |
ba34d4e7cbbe52b890a1393934f8f08ad89e5614 | 3,555 | py | Python | tests/test_utilities.py | tidalwave-it/solidblue3-p-src | 7cd93af3f45c74469cbca4b93fb03728fd2c2338 | [
"Apache-2.0"
] | null | null | null | tests/test_utilities.py | tidalwave-it/solidblue3-p-src | 7cd93af3f45c74469cbca4b93fb03728fd2c2338 | [
"Apache-2.0"
] | null | null | null | tests/test_utilities.py | tidalwave-it/solidblue3-p-src | 7cd93af3f45c74469cbca4b93fb03728fd2c2338 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# SolidBlue III - Open source data manager.
#
# __author__ = "Fabrizio Giudici"
# __copyright__ = "Copyright © 2020 by Fabrizio Giudici"
# __credits__ = ["Fabrizio Giudici"]
# __license__ = "Apache v2"
# __version__ = "1.0-ALPHA-4-SNAPSHOT"
# __maintainer__ = "Fabr... | 43.888889 | 130 | 0.667229 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# SolidBlue III - Open source data manager.
#
# __author__ = "Fabrizio Giudici"
# __copyright__ = "Copyright © 2020 by Fabrizio Giudici"
# __credits__ = ["Fabrizio Giudici"]
# __license__ = "Apache v2"
# __version__ = "1.0-ALPHA-4-SNAPSHOT"
# __maintainer__ = "Fabr... | 2,731 | 18 | 238 |
a0bece183a48b95ce2d9386c045f24ee94381694 | 6,886 | py | Python | ffig/generators/__init__.py | FFIG/ffig | b45060d5835292a74661678872427e3eb5a89d0c | [
"MIT"
] | 31 | 2017-02-03T20:12:11.000Z | 2021-04-14T17:39:56.000Z | ffig/generators/__init__.py | FFIG/ffig | b45060d5835292a74661678872427e3eb5a89d0c | [
"MIT"
] | 246 | 2017-02-03T17:51:24.000Z | 2019-02-14T10:30:19.000Z | ffig/generators/__init__.py | FFIG/ffig | b45060d5835292a74661678872427e3eb5a89d0c | [
"MIT"
] | 9 | 2017-03-05T20:28:37.000Z | 2019-08-28T19:48:22.000Z | import collections
import logging
import os
import os.path
import re
import sys
log = logging.getLogger(__name__)
def render_api_and_obj_classes(module_name, api_classes, template):
'''Render a template.'''
return str(template.render({"module": {"name": module_name},
"classes... | 33.427184 | 86 | 0.652483 | import collections
import logging
import os
import os.path
import re
import sys
log = logging.getLogger(__name__)
def dso_extension():
extensions = {
'darwin': 'dylib',
'win32': 'dll',
'cygwin': 'dll',
'linux2': 'so',
'linux': 'so',
}
return extensions[sys.platform... | 183 | 0 | 23 |
dcad29ce0cc7f03c2df791cc68edc363a54499ab | 344 | py | Python | fixtures/locators/balance.py | berpress/selenium-shop-python-tests | fe8e5b16a7260af333288f1f5ef87ef0badfc31e | [
"Apache-2.0"
] | 1 | 2022-02-03T09:23:40.000Z | 2022-02-03T09:23:40.000Z | fixtures/locators/balance.py | berpress/selenium-shop-python-tests | fe8e5b16a7260af333288f1f5ef87ef0badfc31e | [
"Apache-2.0"
] | null | null | null | fixtures/locators/balance.py | berpress/selenium-shop-python-tests | fe8e5b16a7260af333288f1f5ef87ef0badfc31e | [
"Apache-2.0"
] | null | null | null | from selenium.webdriver.common.by import By
| 28.666667 | 51 | 0.648256 | from selenium.webdriver.common.by import By
class BalanceLocators:
BALANCE_PAGE = (By.ID, "blance-link")
NAME_INPUT = (By.ID, "name")
CARD_INPUT = (By.ID, "card")
CARD_DATE_INPUT = (By.ID, "data-card")
MONEY = (By.ID, "data-money")
AGREE_CHECKBOX = (By.ID, "agree")
BUTTON_SUBMIT = (By.CLAS... | 0 | 276 | 23 |
eb04de70336177724680f36514246b99b3243191 | 2,221 | py | Python | pyctm/mesh_writer.py | mateusazis/pyctm | 7851d3279ea2ce790e24ea996cf8ce3637823ee7 | [
"MIT"
] | null | null | null | pyctm/mesh_writer.py | mateusazis/pyctm | 7851d3279ea2ce790e24ea996cf8ce3637823ee7 | [
"MIT"
] | null | null | null | pyctm/mesh_writer.py | mateusazis/pyctm | 7851d3279ea2ce790e24ea996cf8ce3637823ee7 | [
"MIT"
] | null | null | null | import struct
FILE_FORMAT_VERSION = 5
| 31.728571 | 77 | 0.688879 | import struct
FILE_FORMAT_VERSION = 5
class CompressionMethod(object):
RAW = 0x00574152
MG1 = 0x0031474d
MG2 = 0x0032474d
class MeshWriter(object):
def __init__(self, compression_method=CompressionMethod.RAW):
self.compression_method = compression_method
def write(self, mesh, out):
self.write_hea... | 1,914 | 72 | 196 |
74bc9de7bf24f6b8a89551ef6a80f09b8b125301 | 3,381 | py | Python | functions exerscise/10. Array Manipulator.py | nrgxtra/fundamentals | d9f35eb040c0e1009aad2f7305c035fda207a147 | [
"MIT"
] | null | null | null | functions exerscise/10. Array Manipulator.py | nrgxtra/fundamentals | d9f35eb040c0e1009aad2f7305c035fda207a147 | [
"MIT"
] | null | null | null | functions exerscise/10. Array Manipulator.py | nrgxtra/fundamentals | d9f35eb040c0e1009aad2f7305c035fda207a147 | [
"MIT"
] | null | null | null | numbers = list(map(int, (input()).split(" ")))
command = input()
while command != 'end':
tokens = command.split(" ")
if tokens[0] == 'exchange':
idx = int(tokens[1])
exchange(idx)
elif tokens[0] == 'max':
max_even_odd(tokens[1])
elif tokens[0] == 'min':
... | 27.942149 | 60 | 0.483881 | numbers = list(map(int, (input()).split(" ")))
def exchange(idx):
global numbers
if idx < 0 or idx >= len(numbers):
print("Invalid index")
return
numbers = numbers[idx + 1:] + numbers[:idx + 1]
def max_even_odd(command):
global numbers
if command == 'even':
... | 2,652 | 0 | 125 |
791769926c9f734d226b988c6f7c19037a756017 | 751 | py | Python | cv2u/core/cluster.py | 076923/cv2-utils | 16919450a690870a80c127b41209e338867d3212 | [
"Apache-2.0"
] | null | null | null | cv2u/core/cluster.py | 076923/cv2-utils | 16919450a690870a80c127b41209e338867d3212 | [
"Apache-2.0"
] | null | null | null | cv2u/core/cluster.py | 076923/cv2-utils | 16919450a690870a80c127b41209e338867d3212 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
from sklearn.cluster import DBSCAN as skDBSCAN
| 31.291667 | 72 | 0.653795 | import cv2
import numpy as np
from sklearn.cluster import DBSCAN as skDBSCAN
def DBSCAN(src, eps, min_samples):
arr = cv2.cvtColor(src, cv2.COLOR_BGR2LAB).reshape(-1, src.shape[2])
clustering = skDBSCAN(eps=eps, min_samples=min_samples).fit(arr)
labels = clustering.labels_ + 1
maps = labels.reshape(sr... | 614 | 0 | 50 |
e682f357356fc072527736398cda26287f177f51 | 4,319 | py | Python | app/tests/cases_tests/test_models.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 101 | 2018-04-11T14:48:04.000Z | 2022-03-28T00:29:48.000Z | app/tests/cases_tests/test_models.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 1,733 | 2018-03-21T11:56:16.000Z | 2022-03-31T14:58:30.000Z | app/tests/cases_tests/test_models.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 42 | 2018-06-08T05:49:07.000Z | 2022-03-29T08:43:01.000Z | import uuid
from pathlib import Path
import factory
import pytest
from django.conf import settings
from django.core.exceptions import MultipleObjectsReturned
from django.core.files import File
from tests.cases_tests.factories import (
ImageFactory,
ImageFactoryWithImageFile,
ImageFactoryWithImageFile4D,
... | 32.969466 | 74 | 0.68627 | import uuid
from pathlib import Path
import factory
import pytest
from django.conf import settings
from django.core.exceptions import MultipleObjectsReturned
from django.core.files import File
from tests.cases_tests.factories import (
ImageFactory,
ImageFactoryWithImageFile,
ImageFactoryWithImageFile4D,
... | 3,478 | 2 | 281 |
1440580982caaed7cc65243464b91a21249884e8 | 71 | py | Python | dbml_sqlite/__init__.py | avqpereira/DBML_SQLite | b1a29677e8eb348d1a1a86e293b97045d7d3a85a | [
"MIT"
] | null | null | null | dbml_sqlite/__init__.py | avqpereira/DBML_SQLite | b1a29677e8eb348d1a1a86e293b97045d7d3a85a | [
"MIT"
] | null | null | null | dbml_sqlite/__init__.py | avqpereira/DBML_SQLite | b1a29677e8eb348d1a1a86e293b97045d7d3a85a | [
"MIT"
] | null | null | null | from .core import *
from .terminal import cli
__version__ = '0.2.5'
| 11.833333 | 25 | 0.690141 | from .core import *
from .terminal import cli
__version__ = '0.2.5'
| 0 | 0 | 0 |
540a0b863ddeee851f53f3ebdd09adc0ff556b2d | 6,139 | py | Python | components/Fingerprint/fingerPrint.py | minhan74/MIS-Locker | ab7e90000d566e818b4f44bd27165ed45a8f653f | [
"Apache-2.0",
"MIT"
] | 2 | 2020-07-29T13:38:54.000Z | 2021-07-24T13:54:48.000Z | main/fingerPrint.py | minhan74/MIS-Locker | ab7e90000d566e818b4f44bd27165ed45a8f653f | [
"Apache-2.0",
"MIT"
] | 4 | 2020-02-27T09:53:34.000Z | 2020-02-27T09:54:35.000Z | main/fingerPrint.py | minhan74/MIS-Locker | ab7e90000d566e818b4f44bd27165ed45a8f653f | [
"Apache-2.0",
"MIT"
] | null | null | null | """------------------------------------------------------------*-
fingerPrint module for Raspberry Pi
Tested on: Raspberry Pi 3 B+
(c) Minh-An Dao 2019
(C) Bastian Raschke 2015
version 1.00 - 09/10/2019
--------------------------------------------------------------
*
*
------------------------------------... | 32.141361 | 180 | 0.603193 | """------------------------------------------------------------*-
fingerPrint module for Raspberry Pi
Tested on: Raspberry Pi 3 B+
(c) Minh-An Dao 2019
(C) Bastian Raschke 2015
version 1.00 - 09/10/2019
--------------------------------------------------------------
*
*
------------------------------------... | 4,830 | 0 | 275 |
7dfba4d7aa0b9ffa0b1fb1b7501b1e23ed019ae8 | 1,663 | py | Python | application/data/game_manager.py | Tyler-Yates/crossword-creator | c8358e97d8ccf2567f7ebc9bfe4bc7deb45ff590 | [
"MIT"
] | null | null | null | application/data/game_manager.py | Tyler-Yates/crossword-creator | c8358e97d8ccf2567f7ebc9bfe4bc7deb45ff590 | [
"MIT"
] | null | null | null | application/data/game_manager.py | Tyler-Yates/crossword-creator | c8358e97d8ccf2567f7ebc9bfe4bc7deb45ff590 | [
"MIT"
] | null | null | null | import random
import string
from typing import Optional
from application.data.game_state import GameState
from application.data.word_manager import WordManager
class GameManager:
"""
Manages all the games.
"""
def create_game(self) -> GameState:
"""
Creates a new game.
Retur... | 25.584615 | 80 | 0.615755 | import random
import string
from typing import Optional
from application.data.game_state import GameState
from application.data.word_manager import WordManager
class GameManager:
"""
Manages all the games.
"""
def __init__(self, word_manager: WordManager):
self.games = {}
self.word_m... | 337 | 0 | 80 |
918c49ec89845a96012c81eb22d7e6a610c07e84 | 2,083 | py | Python | dice.py | BCTBB/Dice-Roll | f7a70a60478d16d6da7c1c486d402eb8fdaa5f73 | [
"MIT"
] | null | null | null | dice.py | BCTBB/Dice-Roll | f7a70a60478d16d6da7c1c486d402eb8fdaa5f73 | [
"MIT"
] | null | null | null | dice.py | BCTBB/Dice-Roll | f7a70a60478d16d6da7c1c486d402eb8fdaa5f73 | [
"MIT"
] | null | null | null | import random
@DiceDecorator
input_game = input("What Game are you playing?\n")
if input_game.lower() == "monopoly":
function(input_game,"2d6")
while True:
user_input = input("Roll Again? (Yes or No)\n")
if user_input.lower() == "no":
break
function(input_game, "2d6")
elif ... | 28.930556 | 94 | 0.552568 | import random
class DiceDecorator():
def __init__(self, function):
self.function = function
def __call__(self, *args, **kwargs):
self.function(*args, **kwargs)
def setGame(self):
game = self
return game
def criticalRoll(self):
print("NATURAL 20")
def roll... | 1,275 | 1 | 179 |
23b301dfec4b77f226e8a3a9cbf95cb4999a1121 | 536 | py | Python | semantics/concept.py | andlima/fraseador | 97d48e07cd3c574d92e080fcc81fd0bcad56015f | [
"BSD-3-Clause"
] | 1 | 2018-04-14T16:55:10.000Z | 2018-04-14T16:55:10.000Z | semantics/concept.py | andlima/fraseador | 97d48e07cd3c574d92e080fcc81fd0bcad56015f | [
"BSD-3-Clause"
] | null | null | null | semantics/concept.py | andlima/fraseador | 97d48e07cd3c574d92e080fcc81fd0bcad56015f | [
"BSD-3-Clause"
] | null | null | null | class Concept:
'''Defines a concept and its parents concepts.'''
def __init__(self, index, parents=None):
'''
Attributes:
- self.index: identifies a concept;
- self.parents: this concept's parents.
'''
self.index = index
self.parents = parents
def from... | 22.333333 | 53 | 0.567164 | class Concept:
'''Defines a concept and its parents concepts.'''
def __init__(self, index, parents=None):
'''
Attributes:
- self.index: identifies a concept;
- self.parents: this concept's parents.
'''
self.index = index
self.parents = parents
def from... | 0 | 0 | 0 |
34e8f4157282f86d583abf7ce6ed6d80dfb15f3e | 5,901 | py | Python | mrs_plugin/tests/unit/test_schemas.py | mike-lischke/mysql-shell-plugins | d7d15591dd8e70f7f5ef8ea579e0797eff30fa0a | [
"Apache-2.0",
"CC0-1.0"
] | 11 | 2022-03-02T11:04:16.000Z | 2022-03-29T05:28:23.000Z | mrs_plugin/tests/unit/test_schemas.py | mike-lischke/mysql-shell-plugins | d7d15591dd8e70f7f5ef8ea579e0797eff30fa0a | [
"Apache-2.0",
"CC0-1.0"
] | 1 | 2022-03-25T15:12:16.000Z | 2022-03-31T18:59:22.000Z | mrs_plugin/tests/unit/test_schemas.py | mike-lischke/mysql-shell-plugins | d7d15591dd8e70f7f5ef8ea579e0797eff30fa0a | [
"Apache-2.0",
"CC0-1.0"
] | 3 | 2022-03-24T11:32:12.000Z | 2022-03-25T20:40:14.000Z | # Copyright (c) 2021, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# ... | 32.070652 | 92 | 0.622267 | # Copyright (c) 2021, 2022, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# ... | 4,491 | 0 | 88 |
b7b9b720bdd330dcac5bc907cfe1ee1615a2d089 | 1,579 | py | Python | custom/ewsghana/handlers/keyword.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | custom/ewsghana/handlers/keyword.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | custom/ewsghana/handlers/keyword.py | dborowiecki/commcare-hq | f2f4fa67faec09040a98502f5657444075b63f2e | [
"BSD-3-Clause"
] | null | null | null | from corehq.apps.domain.models import Domain
from corehq.apps.locations.models import SQLLocation
from corehq.apps.sms.api import send_sms_to_verified_number
from corehq.util.translation import localize
from memoized import memoized
| 28.196429 | 86 | 0.681444 | from corehq.apps.domain.models import Domain
from corehq.apps.locations.models import SQLLocation
from corehq.apps.sms.api import send_sms_to_verified_number
from corehq.util.translation import localize
from memoized import memoized
class KeywordHandler(object):
def __init__(self, user, domain, args, msg, verifi... | 1,014 | 308 | 23 |
54eda34ac58953776be75bb1a71c432e3bd6be74 | 1,160 | py | Python | examples/maps.py | RedForester/rf_api_client | c69306be6184740d12c0aea25daae7b795a595f9 | [
"MIT"
] | 1 | 2021-05-28T08:25:09.000Z | 2021-05-28T08:25:09.000Z | examples/maps.py | RedForester/rf_api_client | c69306be6184740d12c0aea25daae7b795a595f9 | [
"MIT"
] | 1 | 2020-12-16T03:42:02.000Z | 2021-04-22T15:54:56.000Z | examples/maps.py | RedForester/rf_api_client | c69306be6184740d12c0aea25daae7b795a595f9 | [
"MIT"
] | 1 | 2020-06-08T14:34:31.000Z | 2020-06-08T14:34:31.000Z | import asyncio
import os
from rf_api_client import RfApiClient
from rf_api_client.models.maps_api_models import MapLayout, NewMapDto
from rf_api_client.rf_api_client import UserAuth
USERNAME = os.getenv('USERNAME')
PASSWORD = os.getenv('PASSWORD')
MAP_ID = os.getenv('MAP_ID')
if __name__ == '__main__':
loop ... | 26.363636 | 69 | 0.684483 | import asyncio
import os
from rf_api_client import RfApiClient
from rf_api_client.models.maps_api_models import MapLayout, NewMapDto
from rf_api_client.rf_api_client import UserAuth
USERNAME = os.getenv('USERNAME')
PASSWORD = os.getenv('PASSWORD')
MAP_ID = os.getenv('MAP_ID')
async def load_map():
async with R... | 621 | 0 | 46 |
716621d821ab31e3e79fbcbc92dd5e9d75d5b58b | 10,386 | py | Python | performance/driver/core/config.py | mesosphere/dcos-perf-test-driver | 8fba87cb6c6f64690c0b5bef5c7d9f2aa0fba06b | [
"Apache-2.0"
] | 2 | 2018-02-27T18:21:21.000Z | 2018-03-16T12:12:12.000Z | performance/driver/core/config.py | mesosphere/dcos-perf-test-driver | 8fba87cb6c6f64690c0b5bef5c7d9f2aa0fba06b | [
"Apache-2.0"
] | 1 | 2018-06-25T07:14:41.000Z | 2018-06-25T07:14:41.000Z | performance/driver/core/config.py | mesosphere/dcos-perf-test-driver | 8fba87cb6c6f64690c0b5bef5c7d9f2aa0fba06b | [
"Apache-2.0"
] | 1 | 2020-06-25T10:37:21.000Z | 2020-06-25T10:37:21.000Z | import importlib
import logging
import yaml
import os
from .eventbus import EventBus
from .template import TemplateDict
from performance.driver.core.utils import parseTimeExpr
# TODO: Make @ expand to `performance.driver.core.classes`
# TODO: Make MetricConfig use ComponentConfig
def mergeConfig(source, destinatio... | 27.994609 | 82 | 0.657423 | import importlib
import logging
import yaml
import os
from .eventbus import EventBus
from .template import TemplateDict
from performance.driver.core.utils import parseTimeExpr
# TODO: Make @ expand to `performance.driver.core.classes`
# TODO: Make MetricConfig use ComponentConfig
def mergeConfig(source, destinatio... | 3,294 | 0 | 350 |
f92a5b4c8650039bae5fb5a730a70ce2b26fca04 | 2,292 | py | Python | src/experiments/LSTM_experiment.py | AU-DIS/LSTM_langid | ca58c1386ad04d17f4fc436755c24163aba4b169 | [
"MIT"
] | 10 | 2021-03-12T07:36:17.000Z | 2022-02-28T12:22:46.000Z | src/experiments/LSTM_experiment.py | AU-DIS/LSTM_langid | ca58c1386ad04d17f4fc436755c24163aba4b169 | [
"MIT"
] | null | null | null | src/experiments/LSTM_experiment.py | AU-DIS/LSTM_langid | ca58c1386ad04d17f4fc436755c24163aba4b169 | [
"MIT"
] | 7 | 2021-03-17T19:23:06.000Z | 2022-02-25T22:44:41.000Z | from typing import Optional
import torch
from sacred import Experiment
from experiments.Experiment_utils import idx_maps, add_tensor_board_writers, run_training, create_logger
from experiments.data_loading import data_loading_ingredient
from src.LSTMLID import LSTMLIDModel
LSTM_exp = Experiment('LSTM_experiment', in... | 38.847458 | 164 | 0.727749 | from typing import Optional
import torch
from sacred import Experiment
from experiments.Experiment_utils import idx_maps, add_tensor_board_writers, run_training, create_logger
from experiments.data_loading import data_loading_ingredient
from src.LSTMLID import LSTMLIDModel
LSTM_exp = Experiment('LSTM_experiment', in... | 1,737 | 0 | 66 |
9f952d77a8c4077ae8d13a641d076da1745c3a9e | 723 | py | Python | jp/co/coworker/nlp_knock_handson/test/ch8/preprocessor_test.py | coworker-jp/nlp-knock-handson | a8a0cb8226f3cb6583e75876af7eef6fed1317c9 | [
"MIT"
] | 1 | 2020-01-26T06:42:08.000Z | 2020-01-26T06:42:08.000Z | jp/co/coworker/nlp_knock_handson/test/ch8/preprocessor_test.py | coworker-jp/nlp-knock-handson | a8a0cb8226f3cb6583e75876af7eef6fed1317c9 | [
"MIT"
] | null | null | null | jp/co/coworker/nlp_knock_handson/test/ch8/preprocessor_test.py | coworker-jp/nlp-knock-handson | a8a0cb8226f3cb6583e75876af7eef6fed1317c9 | [
"MIT"
] | null | null | null | from unittest import TestCase
from jp.co.coworker.nlp_knock_handson.ch8.preprocessor import PreProcessor
| 24.931034 | 74 | 0.57953 | from unittest import TestCase
from jp.co.coworker.nlp_knock_handson.ch8.preprocessor import PreProcessor
class PreProcessorTest(TestCase):
def test_read_dataset(self):
input_lines = [
"+1 I'm happy.",
"-1 I'm sad",
]
actual = PreProcessor.read_dataset(input_lines)... | 528 | 12 | 76 |
fa159f27db9205f185a6716cc752e09e1814f9c3 | 1,175 | py | Python | expert_python/src/thread_queue_test.py | MaiXiaochai/Droplet | 6d7fed9ca76678768a3752fa8df86a021acc3509 | [
"MIT"
] | null | null | null | expert_python/src/thread_queue_test.py | MaiXiaochai/Droplet | 6d7fed9ca76678768a3752fa8df86a021acc3509 | [
"MIT"
] | null | null | null | expert_python/src/thread_queue_test.py | MaiXiaochai/Droplet | 6d7fed9ca76678768a3752fa8df86a021acc3509 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# @File : thread_queue_test.py
# @Time : 2019/2/15 1:11
# @Author : MaiXiaochai
# @Site : https://github.com/MaiXiaochai
import time
import threading
from queue import Queue
if __name__ == '__main__':
main_var()
| 21.759259 | 90 | 0.639149 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# @File : thread_queue_test.py
# @Time : 2019/2/15 1:11
# @Author : MaiXiaochai
# @Site : https://github.com/MaiXiaochai
import time
import threading
from queue import Queue
def get_detail_html(queue):
# 文章详情页
while True:
# get取数据,是一种阻塞的方法,即,若queu... | 966 | 0 | 69 |
72fd1ac9e1958e8fa4933804cd1b1fbbefa839e6 | 468 | py | Python | examples/documentos_consulta.py | robertons/junopy | 1acc64ab99d8ea49bb0dac979cd34da43541f243 | [
"MIT"
] | 3 | 2021-07-12T15:05:13.000Z | 2022-01-31T03:35:43.000Z | examples/documentos_consulta.py | robertons/junopy | 1acc64ab99d8ea49bb0dac979cd34da43541f243 | [
"MIT"
] | 2 | 2022-01-29T20:14:51.000Z | 2022-02-07T16:16:24.000Z | examples/documentos_consulta.py | robertons/junopy | 1acc64ab99d8ea49bb0dac979cd34da43541f243 | [
"MIT"
] | 1 | 2022-02-01T18:36:10.000Z | 2022-02-01T18:36:10.000Z | #-*- coding: utf-8 -*-
import sys
import junopy
if __name__ == "__main__":
main(sys.argv)
| 29.25 | 157 | 0.775641 | #-*- coding: utf-8 -*-
import sys
import junopy
def main(arg):
junopy.Juno('4E1574938F3DD69306BC336E348276ACC9CBE72B4E8396B2520436663C66C08E', '9OuOfYM2QZRhmUug', 'gw<Nl6bc2Ib,VX&)c2U{mX1?d_zEg0^d', sandbox=True)
documentos_esperados = junopy.Document(id='dac_E6FECDB17EAC5992', resourceToken='8A596ED1DEB738... | 348 | 0 | 23 |
35efdf2f0e3f8640bd8f35636d872b82355406ec | 1,500 | py | Python | datasets/dg/VLCS.py | junkunyuan/CSAC | 70d918ed2fe65a0a503b56d66136032031cd67e4 | [
"MIT"
] | 3 | 2022-01-06T06:42:12.000Z | 2022-01-20T04:00:40.000Z | datasets/dg/VLCS.py | junkunyuan/CSAC | 70d918ed2fe65a0a503b56d66136032031cd67e4 | [
"MIT"
] | null | null | null | datasets/dg/VLCS.py | junkunyuan/CSAC | 70d918ed2fe65a0a503b56d66136032031cd67e4 | [
"MIT"
] | null | null | null | from datasets.basedataset import BaseDataset
from .basedata import DGBaseData
import os.path as osp
| 53.571429 | 122 | 0.708667 | from datasets.basedataset import BaseDataset
from .basedata import DGBaseData
import os.path as osp
class VLCS(DGBaseData):
def __init__(self, config, train_transform, test_transform, rtn_pth=False):
super(VLCS, self).__init__(config, train_transform, test_transform, rtn_pth)
def train_dataset(sel... | 1,264 | 2 | 134 |
e2ab5c06de13c602068b74c19c86020c59834eae | 6,113 | py | Python | app.py | m4rker11/Project1_Fintech | 0fa180dbd4b182bd3ebe925399806b5db998760f | [
"MIT"
] | null | null | null | app.py | m4rker11/Project1_Fintech | 0fa180dbd4b182bd3ebe925399806b5db998760f | [
"MIT"
] | null | null | null | app.py | m4rker11/Project1_Fintech | 0fa180dbd4b182bd3ebe925399806b5db998760f | [
"MIT"
] | 2 | 2022-02-10T02:05:44.000Z | 2022-02-18T22:47:35.000Z | from matplotlib.pyplot import spy
import pandas as pd
import questionary
import matplotlib.pyplot as plt
import fire
import utils.gauge as gauge
from utils.MCForecastTools import MCSimulation as MCSimulation
import utils.alpacaConnect as alpacaConnect
import utils.beta_sharpe_functions as stats
if __name__ ==... | 45.281481 | 127 | 0.642565 | from matplotlib.pyplot import spy
import pandas as pd
import questionary
import matplotlib.pyplot as plt
import fire
import utils.gauge as gauge
from utils.MCForecastTools import MCSimulation as MCSimulation
import utils.alpacaConnect as alpacaConnect
import utils.beta_sharpe_functions as stats
def run():
... | 5,735 | 0 | 23 |
4ac9a06d2167a466bc3a27591a59656f0d3d93c9 | 1,541 | py | Python | cjdata/migrations/create_categories_from_markdown.py | sunlightlabs/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 7 | 2015-05-08T03:48:54.000Z | 2016-02-04T01:01:51.000Z | cjdata/migrations/create_categories_from_markdown.py | themarshallproject/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 44 | 2015-03-20T17:16:58.000Z | 2016-04-27T20:17:29.000Z | cjdata/migrations/create_categories_from_markdown.py | sunlightlabs/hall-of-justice | 8c2ce47f792e0182c84d13dca808564a6ac376b4 | [
"BSD-3-Clause"
] | 5 | 2015-06-22T13:49:08.000Z | 2016-01-30T23:19:16.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django.utils.text import slugify
| 34.244444 | 117 | 0.64244 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
from django.utils.text import slugify
def categories_from_markdown(apps, schema_editor):
Category = apps.get_model("cjdata", "Category")
db_alias = schema_editor.connection.alias
top_level_li = '- '
suble... | 1,105 | 228 | 69 |
6465a74218ace9195d9ce564459043b6462093eb | 13,841 | py | Python | src/utilities/MonteCarlo/Dispersions.py | ian-cooke/basilisk_mag | a8b1e37c31c1287549d6fd4d71fcaa35b6fc3f14 | [
"0BSD"
] | null | null | null | src/utilities/MonteCarlo/Dispersions.py | ian-cooke/basilisk_mag | a8b1e37c31c1287549d6fd4d71fcaa35b6fc3f14 | [
"0BSD"
] | 1 | 2019-03-13T20:52:22.000Z | 2019-03-13T20:52:22.000Z | src/utilities/MonteCarlo/Dispersions.py | ian-cooke/basilisk_mag | a8b1e37c31c1287549d6fd4d71fcaa35b6fc3f14 | [
"0BSD"
] | null | null | null | ''' '''
'''
ISC License
Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all c... | 37.307278 | 115 | 0.613395 | ''' '''
'''
ISC License
Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all c... | 8,729 | 3,505 | 647 |
ad225a91fda7f19944629bddec79028224b8679d | 4,599 | py | Python | Collision/Collision_BarChart.py | ChairOfStructuralMechanicsTUM/Mechanics_Apps | b064a42d4df3fa9bde62a5cff9cb27ca61b0127c | [
"MIT"
] | 11 | 2017-05-06T17:05:29.000Z | 2020-11-12T09:26:47.000Z | Collision/Collision_BarChart.py | ChairOfStructuralMechanicsTUM/Mechanics_Apps | b064a42d4df3fa9bde62a5cff9cb27ca61b0127c | [
"MIT"
] | 49 | 2017-04-20T11:26:11.000Z | 2020-05-29T13:18:06.000Z | Collision/Collision_BarChart.py | ChairOfStructuralMechanicsTUM/Mechanics_Apps | b064a42d4df3fa9bde62a5cff9cb27ca61b0127c | [
"MIT"
] | 4 | 2017-02-14T12:55:34.000Z | 2022-01-12T15:07:07.000Z | from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Range1d, FuncTickFormatter, FixedTicker
from math import pi, floor
#ColourOptions = ["red","blue","green","black","yellow","purple"]
# define operator[]
| 35.929688 | 110 | 0.546858 | from bokeh.plotting import figure
from bokeh.models import ColumnDataSource, Range1d, FuncTickFormatter, FixedTicker
from math import pi, floor
#ColourOptions = ["red","blue","green","black","yellow","purple"]
class Collision_BarChart(object):
def __init__(self, xVals, yVals, colours = None, width=None):
... | 4,037 | 12 | 309 |
8c5ef186939dc52a723f26a4f2acb470a4beb51c | 159 | py | Python | cashaccount/__init__.py | YumenoG/pycashaccount | f2a22eec729cc7b608241e1632d2ccde5fcc3bbc | [
"MIT"
] | 2 | 2019-02-20T12:28:19.000Z | 2019-02-20T12:28:22.000Z | cashaccount/__init__.py | YumenoG/pycashaccount | f2a22eec729cc7b608241e1632d2ccde5fcc3bbc | [
"MIT"
] | 5 | 2019-01-03T19:35:17.000Z | 2019-02-20T12:34:11.000Z | cashaccount/__init__.py | YumenoG/pycashaccount | f2a22eec729cc7b608241e1632d2ccde5fcc3bbc | [
"MIT"
] | 1 | 2019-10-16T11:30:33.000Z | 2019-10-16T11:30:33.000Z | from .payment import KeyHashInfo, ScriptHashInfo, PaymentCodeInfo
from .registration import Registration
from .registration import electron_markdown, opreturn
| 39.75 | 65 | 0.867925 | from .payment import KeyHashInfo, ScriptHashInfo, PaymentCodeInfo
from .registration import Registration
from .registration import electron_markdown, opreturn
| 0 | 0 | 0 |
86cff8875e7daac75ac54d06d2c85aaac944d826 | 30 | py | Python | base/__init__.py | mswilkhu1/ssense | 59987a3c492591c8217811e79a63f25652f0295c | [
"MIT"
] | null | null | null | base/__init__.py | mswilkhu1/ssense | 59987a3c492591c8217811e79a63f25652f0295c | [
"MIT"
] | null | null | null | base/__init__.py | mswilkhu1/ssense | 59987a3c492591c8217811e79a63f25652f0295c | [
"MIT"
] | null | null | null | from . import initiate_driver
| 15 | 29 | 0.833333 | from . import initiate_driver
| 0 | 0 | 0 |
df0f94ca69a8a385c0768dcc35920f208f66991a | 2,642 | py | Python | clonest1ck-python3/3dec.py | joelfak/advent_of_code_2019 | d5031078c53c181835b4bf86458b360542f0122e | [
"Apache-2.0"
] | 9 | 2019-12-01T14:52:40.000Z | 2020-12-16T14:24:19.000Z | clonest1ck-python3/3dec.py | joelfak/advent_of_code_2019 | d5031078c53c181835b4bf86458b360542f0122e | [
"Apache-2.0"
] | null | null | null | clonest1ck-python3/3dec.py | joelfak/advent_of_code_2019 | d5031078c53c181835b4bf86458b360542f0122e | [
"Apache-2.0"
] | 51 | 2019-11-26T14:49:05.000Z | 2021-12-01T20:53:41.000Z |
file_content = open("3dec-input", 'r')
#file_content = ["R75,D30,R83,U83,L12,D49,R71,U7,L72", "U62,R66,U55,R34,D71,R55,D58,R83"]
#file_content = ["R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51", "U98,R91,D20,R16,D67,R40,U7,R15,U6,R7"]
#file_content = ["R8,U5,L5,D3", "U7,R6,D4,L4"]
paths = []
for line in file_content:
... | 23.589286 | 103 | 0.572294 |
def parse(step):
direction = step[0]
distance = int(step[1:])
delta = (0,0)
if direction == "D":
delta = (0,-distance)
elif direction == "U":
delta = (0, distance)
elif direction == "L":
delta = (-distance, 0)
elif direction == "R":
delta = (distance, 0)
... | 2,004 | 0 | 184 |
a2fe41fc14e29841c949296a4168fcce762dec97 | 1,775 | py | Python | setup.py | baojianzhou/sparse-learn | ed01f2c3d518c0c48652bc4fe4dc552ba3d5a427 | [
"MIT"
] | null | null | null | setup.py | baojianzhou/sparse-learn | ed01f2c3d518c0c48652bc4fe4dc552ba3d5a427 | [
"MIT"
] | null | null | null | setup.py | baojianzhou/sparse-learn | ed01f2c3d518c0c48652bc4fe4dc552ba3d5a427 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This is a wrapper of head and tail projection. To generate sparse_module.so
file, please use the following command (suppose you have Linux/MacOS/MacBook):
python setup.py build_ext --inplace
"""
import os
import numpy
from setuptools import setup
from setuptools import find_packages
fro... | 34.134615 | 78 | 0.651268 | # -*- coding: utf-8 -*-
"""
This is a wrapper of head and tail projection. To generate sparse_module.so
file, please use the following command (suppose you have Linux/MacOS/MacBook):
python setup.py build_ext --inplace
"""
import os
import numpy
from setuptools import setup
from setuptools import find_packages
fro... | 0 | 0 | 0 |
03fad4a2150e4137547fe60f73588d537020e568 | 852 | py | Python | data/migrations/0007_auto_20181118_2258.py | ve7cxz/ferrystatus | ac52eaf7d8c562bd67e256ced9f4c8a04b232d8f | [
"MIT"
] | 1 | 2019-02-26T15:27:42.000Z | 2019-02-26T15:27:42.000Z | data/migrations/0007_auto_20181118_2258.py | ve7cxz/ferrystatus | ac52eaf7d8c562bd67e256ced9f4c8a04b232d8f | [
"MIT"
] | null | null | null | data/migrations/0007_auto_20181118_2258.py | ve7cxz/ferrystatus | ac52eaf7d8c562bd67e256ced9f4c8a04b232d8f | [
"MIT"
] | null | null | null | # Generated by Django 2.1.3 on 2018-11-18 22:58
from django.db import migrations, models
import django.db.models.deletion
| 28.4 | 202 | 0.580986 | # Generated by Django 2.1.3 on 2018-11-18 22:58
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('data', '0006_auto_20181118_0849'),
]
operations = [
migrations.CreateModel(
name='StoppedEvent'... | 0 | 705 | 23 |
c2dc50b1cd89e4d481d3ac5b003799a4bd24d149 | 4,329 | py | Python | example/example/settings.py | Microdisseny/django-field-filemanager | 4c985cc9906fa740af36f123d69798630ff51813 | [
"MIT"
] | null | null | null | example/example/settings.py | Microdisseny/django-field-filemanager | 4c985cc9906fa740af36f123d69798630ff51813 | [
"MIT"
] | 9 | 2018-10-05T05:47:58.000Z | 2019-09-30T21:56:52.000Z | example/example/settings.py | Microdisseny/django-field-filemanager | 4c985cc9906fa740af36f123d69798630ff51813 | [
"MIT"
] | null | null | null | """
Django settings for example project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
A... | 27.226415 | 101 | 0.693232 | """
Django settings for example project.
Generated by 'django-admin startproject' using Django 2.1.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
A... | 0 | 0 | 0 |
1a74aeee0337351fbd9390dd6cc7b71b2e98beb3 | 3,385 | py | Python | mindspore/python/mindspore/train/callback/_history.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/train/callback/_history.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/train/callback/_history.py | zhz44/mindspore | 6044d34074c8505dd4b02c0a05419cbc32a43f86 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 40.297619 | 112 | 0.637518 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | 64 | 0 | 26 |
68aaea2672ff3fcb45c14f84b1bb337e703b0d8d | 687 | py | Python | pypy/module/posix/test/test_nt.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-06-02T23:02:09.000Z | 2021-06-02T23:02:09.000Z | pypy/module/posix/test/test_nt.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-03-30T18:08:41.000Z | 2021-03-30T18:08:41.000Z | pypy/module/posix/test/test_nt.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2022-03-30T11:42:37.000Z | 2022-03-30T11:42:37.000Z | import os
import sys
import py
if not sys.platform.startswith('win'):
py.test.skip("requires Windows")
from pypy.module.posix import interp_nt as nt
| 24.535714 | 72 | 0.678311 | import os
import sys
import py
if not sys.platform.startswith('win'):
py.test.skip("requires Windows")
from pypy.module.posix import interp_nt as nt
def test__getfileinformation():
with open(__file__) as fp:
stat = os.fstat(fp.fileno())
info = nt._getfileinformation(fp.fileno())
serial,... | 483 | 0 | 46 |
ed0e27fce61f138eb87a95a873cf0e4750c6ac1b | 4,321 | py | Python | forecaster/models/layers.py | ZiyangTian/TrajectoryForecaster | 63ab3d7b97ec5dfbb1250af114038a6ad5a7faa9 | [
"MIT"
] | null | null | null | forecaster/models/layers.py | ZiyangTian/TrajectoryForecaster | 63ab3d7b97ec5dfbb1250af114038a6ad5a7faa9 | [
"MIT"
] | null | null | null | forecaster/models/layers.py | ZiyangTian/TrajectoryForecaster | 63ab3d7b97ec5dfbb1250af114038a6ad5a7faa9 | [
"MIT"
] | null | null | null | """ `tf.keras.layers.Layer` subclasses. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import tensorflow as tf
from forecaster.ops.diff import diff_1_pad
from forecaster.ops.diff import diff_pad
... | 38.580357 | 100 | 0.664198 | """ `tf.keras.layers.Layer` subclasses. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import tensorflow as tf
from forecaster.ops.diff import diff_1_pad
from forecaster.ops.diff import diff_pad
... | 3,332 | 130 | 532 |
620848f7c59cca1cbc7bccf648b9f0742cbf39fe | 22,118 | py | Python | services/ows_refactored/vegetation/styles_ndvi_clim.py | FlexiGroBots-H2020/datacube-config | 8d6c61cf7c9a68552176aeb4aabc7ac6c3fc5a91 | [
"Apache-2.0"
] | null | null | null | services/ows_refactored/vegetation/styles_ndvi_clim.py | FlexiGroBots-H2020/datacube-config | 8d6c61cf7c9a68552176aeb4aabc7ac6c3fc5a91 | [
"Apache-2.0"
] | null | null | null | services/ows_refactored/vegetation/styles_ndvi_clim.py | FlexiGroBots-H2020/datacube-config | 8d6c61cf7c9a68552176aeb4aabc7ac6c3fc5a91 | [
"Apache-2.0"
] | null | null | null | from ows_refactored.common.ows_legend_cfg import (
legend_mean_ndvi_ticks,
legend_stddev_ndvi_ticks,
)
# colour ramps-------------------------------------
mean_cr = [
{"value": -0.0, "color": "#000000", "alpha": 0.0},
{"value": 0.0, "color": "#d73027"},
{"value": 0.1, "color": "#f46d43"},
{"val... | 28.502577 | 76 | 0.555701 | from ows_refactored.common.ows_legend_cfg import (
legend_mean_ndvi_ticks,
legend_stddev_ndvi_ticks,
)
# colour ramps-------------------------------------
mean_cr = [
{"value": -0.0, "color": "#000000", "alpha": 0.0},
{"value": 0.0, "color": "#d73027"},
{"value": 0.1, "color": "#f46d43"},
{"val... | 0 | 0 | 0 |
641ba4644d47fec93eae2e6c4972496fd38e9851 | 2,394 | py | Python | SCTF/2017 Finals/iem/IEM.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | 1 | 2021-08-24T22:16:41.000Z | 2021-08-24T22:16:41.000Z | SCTF/2017 Finals/iem/IEM.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | SCTF/2017 Finals/iem/IEM.py | PurpEth/solved-hacking-problem | 6f289d1647eb9c091caa580c7aae673e3ba02952 | [
"Unlicense"
] | null | null | null | from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
from SCTF import check_user, check_user_auth, FLAG
import random
import sys
import os
if __name__ == '__main__':
if len(sys.argv) >= 3:
addr, port = sys.argv[1], int(sys.argv[2])
else:
addr... | 28.164706 | 69 | 0.549708 | from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
from SCTF import check_user, check_user_auth, FLAG
import random
import sys
import os
class IteratedEvenMansour():
def __init__(self, keys):
self.keys = keys
self.rndMap = self.genRndMap('I love C... | 1,558 | 69 | 202 |
280d7536a3378b2a108baf99c293a9c6642ee0d6 | 515 | py | Python | tests/terminal/test_namespace.py | danilosoarescardoso/cloud-native-edition | b8aa66119dc4440b1ca3741a4065c9ae7feb42fb | [
"Apache-2.0"
] | 1 | 2021-04-04T04:25:49.000Z | 2021-04-04T04:25:49.000Z | tests/terminal/test_namespace.py | danilosoarescardoso/cloud-native-edition | b8aa66119dc4440b1ca3741a4065c9ae7feb42fb | [
"Apache-2.0"
] | null | null | null | tests/terminal/test_namespace.py | danilosoarescardoso/cloud-native-edition | b8aa66119dc4440b1ca3741a4065c9ae7feb42fb | [
"Apache-2.0"
] | null | null | null | import pytest
@pytest.mark.parametrize("given, expected", [
("", "gluu"),
("my-ns", "my-ns"),
])
| 32.1875 | 77 | 0.72233 | import pytest
@pytest.mark.parametrize("given, expected", [
("", "gluu"),
("my-ns", "my-ns"),
])
def test_gluu_namespace(monkeypatch, settings, given, expected):
from pygluu.kubernetes.terminal.namespace import PromptNamespace
monkeypatch.setattr("click.prompt", lambda x, default: given or expected)
... | 386 | 0 | 22 |
d79ae444349e6fb00620225ff2425a443fd305dd | 4,757 | py | Python | src/main/inpaint_videos.py | MichiganCOG/devil | 296115cd5f4952c7dc65bbcaaf2d1d5c55ef5d35 | [
"MIT"
] | 8 | 2021-05-13T02:37:16.000Z | 2021-09-22T09:28:52.000Z | src/main/inpaint_videos.py | MichiganCOG/devil | 296115cd5f4952c7dc65bbcaaf2d1d5c55ef5d35 | [
"MIT"
] | 3 | 2021-07-30T11:55:56.000Z | 2022-03-24T04:33:46.000Z | src/main/inpaint_videos.py | MichiganCOG/devil | 296115cd5f4952c7dc65bbcaaf2d1d5c55ef5d35 | [
"MIT"
] | 1 | 2021-06-10T08:43:12.000Z | 2021-06-10T08:43:12.000Z | import argparse
import os
import shutil
from subprocess import check_call
from tempfile import TemporaryDirectory
from PIL import Image
from ..common_util.misc import makedirs
from ..video_inpainting import create_padded_masked_video_dataset
from ..video_inpainting.util import PILImagePadder
def _unpad_copy_frames... | 48.050505 | 118 | 0.701282 | import argparse
import os
import shutil
from subprocess import check_call
from tempfile import TemporaryDirectory
from PIL import Image
from ..common_util.misc import makedirs
from ..video_inpainting import create_padded_masked_video_dataset
from ..video_inpainting.util import PILImagePadder
def main(frames_dataset... | 1,833 | 0 | 23 |
446b1478ed039ec47e7afe0a3a8e31d34f5d25ac | 147 | py | Python | module08-mongodb.programming.using.pymongo/exercise01.py | deepcloudlabs/dcl162-2020-sep-09 | dc05aa6e644610fe0cdb8f9de1074763fc77a3bb | [
"MIT"
] | null | null | null | module08-mongodb.programming.using.pymongo/exercise01.py | deepcloudlabs/dcl162-2020-sep-09 | dc05aa6e644610fe0cdb8f9de1074763fc77a3bb | [
"MIT"
] | null | null | null | module08-mongodb.programming.using.pymongo/exercise01.py | deepcloudlabs/dcl162-2020-sep-09 | dc05aa6e644610fe0cdb8f9de1074763fc77a3bb | [
"MIT"
] | 1 | 2020-10-04T10:58:31.000Z | 2020-10-04T10:58:31.000Z | from pymongo import MongoClient
client = MongoClient("mongodb://localhost:27017")
for db_name in client.list_database_names():
print(db_name) | 24.5 | 49 | 0.782313 | from pymongo import MongoClient
client = MongoClient("mongodb://localhost:27017")
for db_name in client.list_database_names():
print(db_name) | 0 | 0 | 0 |
722009c45ecdd1ff91fccdc1118ff3309b190062 | 105 | py | Python | pymunk-5.4.2/pymunk/_chipmunk_cffi.py | mturja-vf-ic-bd/self-driving-car_Robotics-Project | f84781bb19c2371783e306e9b17b7f3cc2267c3c | [
"MIT"
] | null | null | null | pymunk-5.4.2/pymunk/_chipmunk_cffi.py | mturja-vf-ic-bd/self-driving-car_Robotics-Project | f84781bb19c2371783e306e9b17b7f3cc2267c3c | [
"MIT"
] | null | null | null | pymunk-5.4.2/pymunk/_chipmunk_cffi.py | mturja-vf-ic-bd/self-driving-car_Robotics-Project | f84781bb19c2371783e306e9b17b7f3cc2267c3c | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from pymunk._chipmunk_cffi_abi import ffi, lib, lib_path
| 26.25 | 58 | 0.790476 | from __future__ import absolute_import
from pymunk._chipmunk_cffi_abi import ffi, lib, lib_path
| 0 | 0 | 0 |
0bb4745aef8db3d092af6262cf8982de19648c0b | 806 | py | Python | tests/test_tools/test_w_states.py | jdrusso/westpa_test | 3383b59a5a6ec5401415e74eb5a7fc61e4b3abbc | [
"MIT"
] | null | null | null | tests/test_tools/test_w_states.py | jdrusso/westpa_test | 3383b59a5a6ec5401415e74eb5a7fc61e4b3abbc | [
"MIT"
] | null | null | null | tests/test_tools/test_w_states.py | jdrusso/westpa_test | 3383b59a5a6ec5401415e74eb5a7fc61e4b3abbc | [
"MIT"
] | null | null | null | import argparse
from westpa.cli.core.w_states import entry_point
from unittest import mock
from pytest import fixture
| 28.785714 | 114 | 0.64268 | import argparse
from westpa.cli.core.w_states import entry_point
from unittest import mock
from pytest import fixture
class Test_W_States:
def test_run_w_states(self, ref_initialized):
'''Tests running w_states on a sample h5 file'''
with mock.patch(
target='argparse.ArgumentParser.p... | 29 | 634 | 23 |