hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c326417f077d789ca1b7eb5a188712ad78f5c31 | 1,986 | py | Python | src/metabase_manager/registry.py | chasleslr/metabase-manager | 091d2146d08850f2020a3c8b1d23f8deb5dce888 | [
"MIT"
] | null | null | null | src/metabase_manager/registry.py | chasleslr/metabase-manager | 091d2146d08850f2020a3c8b1d23f8deb5dce888 | [
"MIT"
] | 19 | 2022-03-05T02:03:45.000Z | 2022-03-21T03:02:06.000Z | src/metabase_manager/registry.py | chasleslr/metabase-manager | 091d2146d08850f2020a3c8b1d23f8deb5dce888 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import List, Optional, Type
import metabase
from metabase import (
Database,
Field,
Metabase,
Metric,
PermissionGroup,
Segment,
Table,
User,
)
from metabase.resource import Resource
from metabase_manager.exceptions import DuplicateKe... | 29.205882 | 81 | 0.646526 | from dataclasses import dataclass, field
from typing import List, Optional, Type
import metabase
from metabase import (
Database,
Field,
Metabase,
Metric,
PermissionGroup,
Segment,
Table,
User,
)
from metabase.resource import Resource
from metabase_manager.exceptions import DuplicateKe... | true | true |
1c3264d05fa3133a8547727b7c7c279a53e36aba | 219 | py | Python | backend/views/meta.py | TeamAutoMod/AutoMod | 5934881c7bb71ba17c8e40e11c6fd2bcfad7ae50 | [
"MIT"
] | 13 | 2021-09-29T13:08:23.000Z | 2022-03-21T20:59:27.000Z | backend/views/meta.py | TeamAutoMod/AutoMod | 5934881c7bb71ba17c8e40e11c6fd2bcfad7ae50 | [
"MIT"
] | null | null | null | backend/views/meta.py | TeamAutoMod/AutoMod | 5934881c7bb71ba17c8e40e11c6fd2bcfad7ae50 | [
"MIT"
] | 7 | 2021-09-26T19:10:47.000Z | 2022-03-26T11:27:11.000Z | import discord
from discord.ui import View
from .buttons import DeleteBtn
class DeleteView(View):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_item(DeleteBtn()) | 19.909091 | 41 | 0.684932 | import discord
from discord.ui import View
from .buttons import DeleteBtn
class DeleteView(View):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_item(DeleteBtn()) | true | true |
1c32653de6c0dc6659fc5d9ed3f6ce46cdd2ed42 | 2,067 | py | Python | data/test/python/1c32653de6c0dc6659fc5d9ed3f6ce46cdd2ed42market_v4.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/test/python/1c32653de6c0dc6659fc5d9ed3f6ce46cdd2ed42market_v4.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/test/python/1c32653de6c0dc6659fc5d9ed3f6ce46cdd2ed42market_v4.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | from __future__ import print_function
from multiprocessing import Process
import zmq
import itertools
from lib import *
import Queue
context = zmq.Context()
from traders import Trader
from brokers import JobQueueBroker
from workers import AuthWorker, DBWorker
from time import sleep
AddressManager.register_endpoint('... | 31.8 | 134 | 0.734398 | from __future__ import print_function
from multiprocessing import Process
import zmq
import itertools
from lib import *
import Queue
context = zmq.Context()
from traders import Trader
from brokers import JobQueueBroker
from workers import AuthWorker, DBWorker
from time import sleep
AddressManager.register_endpoint('... | true | true |
1c32658d8f2697e42b6d3d48d7586f3159a5887a | 117 | py | Python | Part 1/Chapter 10/exercise_10.11a.py | kg55555/pypractice | 1867f001b3d2a7174ea00d7b9e2fa22e9f1877ef | [
"MIT"
] | null | null | null | Part 1/Chapter 10/exercise_10.11a.py | kg55555/pypractice | 1867f001b3d2a7174ea00d7b9e2fa22e9f1877ef | [
"MIT"
] | null | null | null | Part 1/Chapter 10/exercise_10.11a.py | kg55555/pypractice | 1867f001b3d2a7174ea00d7b9e2fa22e9f1877ef | [
"MIT"
] | null | null | null | import json
fav = input("What is your favourite number?\n")
with open('r_fav', 'w') as fn:
json.dump(fav, fn)
| 14.625 | 47 | 0.641026 | import json
fav = input("What is your favourite number?\n")
with open('r_fav', 'w') as fn:
json.dump(fav, fn)
| true | true |
1c326597414a341be5f886a62626944c3c0b78dc | 1,879 | py | Python | apolloMusicRipper/run.py | ebber/apolloRipper | 863789229639036c5d4bc0d021b9cef0c8c41167 | [
"MIT"
] | null | null | null | apolloMusicRipper/run.py | ebber/apolloRipper | 863789229639036c5d4bc0d021b9cef0c8c41167 | [
"MIT"
] | null | null | null | apolloMusicRipper/run.py | ebber/apolloRipper | 863789229639036c5d4bc0d021b9cef0c8c41167 | [
"MIT"
] | null | null | null | import os
import config
from ripper.ytRipper import Ripper
from model.song import Song
from tagging.tagger import Tagger
import logging
tagger = Tagger()
ripper = Ripper()
notDone = True
logger = logging.getLogger("mainLoopLogger")
#goes through all songs in the directory, calls tagFile
def tagDir(dir=config.DIR_UNT... | 27.632353 | 79 | 0.625865 | import os
import config
from ripper.ytRipper import Ripper
from model.song import Song
from tagging.tagger import Tagger
import logging
tagger = Tagger()
ripper = Ripper()
notDone = True
logger = logging.getLogger("mainLoopLogger")
def tagDir(dir=config.DIR_UNTAGGED):
logger.info("tagging songs in "+dir)
fo... | true | true |
1c3265c5e63e7d32d1a24668a6009ee611fd3470 | 1,086 | py | Python | similarity/discursos_separados_em_json.py | Oguiraw/Me-diz-quem-tu-es | 66d2d79f789f112f70f81d38fed57e3a9c87be86 | [
"MIT"
] | null | null | null | similarity/discursos_separados_em_json.py | Oguiraw/Me-diz-quem-tu-es | 66d2d79f789f112f70f81d38fed57e3a9c87be86 | [
"MIT"
] | null | null | null | similarity/discursos_separados_em_json.py | Oguiraw/Me-diz-quem-tu-es | 66d2d79f789f112f70f81d38fed57e3a9c87be86 | [
"MIT"
] | 1 | 2018-12-19T16:21:55.000Z | 2018-12-19T16:21:55.000Z | import gensim, nltk, re, json, os
from gensim import corpora,similarities, models
from nltk.tokenize import word_tokenize
from datetime import date,datetime
import csv
import base64
from sklearn.cluster import k_means
import numpy as np
csv.field_size_limit(100000000)
def open_file(name_file,data):
with open(name... | 27.15 | 72 | 0.631676 | import gensim, nltk, re, json, os
from gensim import corpora,similarities, models
from nltk.tokenize import word_tokenize
from datetime import date,datetime
import csv
import base64
from sklearn.cluster import k_means
import numpy as np
csv.field_size_limit(100000000)
def open_file(name_file,data):
with open(name... | true | true |
1c3266a4c989d03da9f5adcb2e5b18de48ce8374 | 5,878 | py | Python | ManageOrdersS3.py | jorgeMorfinezM/AwsS3FileManager | 443800c58371391b8c127ed538c21766b2315eac | [
"Apache-2.0"
] | 1 | 2020-08-13T21:28:19.000Z | 2020-08-13T21:28:19.000Z | ManageOrdersS3.py | jorgeMorfinezM/AwsS3FileManager | 443800c58371391b8c127ed538c21766b2315eac | [
"Apache-2.0"
] | null | null | null | ManageOrdersS3.py | jorgeMorfinezM/AwsS3FileManager | 443800c58371391b8c127ed538c21766b2315eac | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Requires Python 3.6 or later
"""
__author__ = "Jorge Morfinez Mojica (jorge.morfinez.m@gmail.com)"
__copyright__ = "Copyright 2020, Jorge Morfinez Mojica"
__license__ = ""
__history__ = """ Se conecta, valida y copia
documentos/archivos a un
Bucket de A... | 27.85782 | 102 | 0.652943 |
__author__ = "Jorge Morfinez Mojica (jorge.morfinez.m@gmail.com)"
__copyright__ = "Copyright 2020, Jorge Morfinez Mojica"
__license__ = ""
__history__ = """ Se conecta, valida y copia
documentos/archivos a un
Bucket de AWS S3 a partir
de un directorio local."""... | true | true |
1c3266af38e628e6e69888ae24ffb3ecb5af0766 | 1,717 | py | Python | CodeGenX64/isel_tester.py | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 171 | 2020-01-30T16:58:07.000Z | 2022-03-27T22:12:17.000Z | CodeGenX64/isel_tester.py | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 14 | 2021-05-15T02:12:09.000Z | 2022-03-16T04:16:18.000Z | CodeGenX64/isel_tester.py | robertmuth/Cwerg | fdf30b06c93b4620c0a45b448b6d92acb81c35f0 | [
"Apache-2.0"
] | 5 | 2021-03-01T20:52:13.000Z | 2022-03-07T06:35:03.000Z | #!/usr/bin/python3
"""Testing helper for table driven code selection"""
from CpuX64 import symbolic
from Base import serialize
from Base import ir
from CodeGenX64 import isel_tab
from CodeGenX64 import regs
from typing import Any
import sys
def OpToStr(op: Any) -> str:
return str(op)
def OpTypeStr(op: Any) ->... | 27.693548 | 77 | 0.627257 |
from CpuX64 import symbolic
from Base import serialize
from Base import ir
from CodeGenX64 import isel_tab
from CodeGenX64 import regs
from typing import Any
import sys
def OpToStr(op: Any) -> str:
return str(op)
def OpTypeStr(op: Any) -> str:
if isinstance(op, ir.Reg):
return op.kind.name
el... | true | true |
1c3266af66ce2cbcce02c1fab886491c7e384cea | 2,607 | py | Python | aedes_server/core/models.py | henriquenogueira/aedes | 43b8376a091c57dd45d342dea78301c0a79b5df0 | [
"MIT"
] | null | null | null | aedes_server/core/models.py | henriquenogueira/aedes | 43b8376a091c57dd45d342dea78301c0a79b5df0 | [
"MIT"
] | 8 | 2016-03-27T03:15:42.000Z | 2016-03-28T23:59:55.000Z | aedes_server/core/models.py | henriquenogueira/aedes | 43b8376a091c57dd45d342dea78301c0a79b5df0 | [
"MIT"
] | null | null | null | from django.db import models
class Report(models.Model):
'''
Model that represents a given report by an user.
It contains information about the location of
the report as well as the type and timestamp.
'''
REPORT_CATEGORIES = (
('F', 'Foco'), # Represents a potential place where aede... | 38.910448 | 99 | 0.666667 | from django.db import models
class Report(models.Model):
REPORT_CATEGORIES = (
('F', 'Foco'),
('C', 'Criadouro'),
('SD', 'Suspeita de dengue'), # Someone near feeling symptoms of dengue
('SZ', 'Suspeita de zika'), # Someone near feeling symptoms of zika
('SC', 'Suspe... | true | true |
1c32683d609fb544f45af4fd713ee418abb2c7ad | 3,311 | py | Python | example/dj/apps/test_chamber/tests/models/dispatchers.py | rubickcz/django-chamber | 0b4c51c66e0f496c6ebdbf4130bab8dd2fc53984 | [
"BSD-3-Clause"
] | null | null | null | example/dj/apps/test_chamber/tests/models/dispatchers.py | rubickcz/django-chamber | 0b4c51c66e0f496c6ebdbf4130bab8dd2fc53984 | [
"BSD-3-Clause"
] | null | null | null | example/dj/apps/test_chamber/tests/models/dispatchers.py | rubickcz/django-chamber | 0b4c51c66e0f496c6ebdbf4130bab8dd2fc53984 | [
"BSD-3-Clause"
] | null | null | null | from nose.tools import raises # pylint: disable=E0401
from django.core.exceptions import ImproperlyConfigured
from django.test import TransactionTestCase
from chamber.models.dispatchers import BaseDispatcher, StateDispatcher
from chamber.shortcuts import change_and_save
from chamber.utils.transaction import transact... | 45.986111 | 109 | 0.749018 | from nose.tools import raises
from django.core.exceptions import ImproperlyConfigured
from django.test import TransactionTestCase
from chamber.models.dispatchers import BaseDispatcher, StateDispatcher
from chamber.shortcuts import change_and_save
from chamber.utils.transaction import transaction_signals
from germa... | true | true |
1c3269d2b4f3191e5d18f00db8deca25f16330f6 | 2,748 | py | Python | fairml/metrics/utils.py | SchernHe/FairML | ebd32df6dec1d5232e05e18c88e89179a420659e | [
"MIT"
] | null | null | null | fairml/metrics/utils.py | SchernHe/FairML | ebd32df6dec1d5232e05e18c88e89179a420659e | [
"MIT"
] | null | null | null | fairml/metrics/utils.py | SchernHe/FairML | ebd32df6dec1d5232e05e18c88e89179a420659e | [
"MIT"
] | null | null | null | """Provides useful functions to calculate fairness metrics"""
from sklearn.metrics import confusion_matrix, accuracy_score, precision_score
import numpy as np
import pandas as pd
def calculate_precision(df, target_variable, prediction_variable):
"""Calculate precision / positive predictive value PPV"""
tn, fp... | 28.329897 | 86 | 0.654294 | from sklearn.metrics import confusion_matrix, accuracy_score, precision_score
import numpy as np
import pandas as pd
def calculate_precision(df, target_variable, prediction_variable):
tn, fp, fn, tp = confusion_matrix(
df[target_variable], df[prediction_variable]
).ravel()
if (tp + fp) != 0:
... | true | true |
1c326a10a08831667792f3baae827a68ee85eae2 | 32,426 | py | Python | metalcode_v1_0.py | mpiecka/metalcode | b0306dc9d8de53d797c946254fa63fa8b3fbf093 | [
"MIT"
] | 1 | 2021-12-13T17:20:44.000Z | 2021-12-13T17:20:44.000Z | metalcode_v1_0.py | mpiecka/metalcode | b0306dc9d8de53d797c946254fa63fa8b3fbf093 | [
"MIT"
] | null | null | null | metalcode_v1_0.py | mpiecka/metalcode | b0306dc9d8de53d797c946254fa63fa8b3fbf093 | [
"MIT"
] | null | null | null | from numpy import *
import matplotlib.pyplot as plt
import time
import os
import warnings
warnings.filterwarnings("ignore", category=VisibleDeprecationWarning)
# from metalcode_calib_metal import metal_transf
from metalcode_calib_tempe import Teff
from metalcode_calib_tempe import BolCorBV
from metalcode_cal... | 44.541209 | 570 | 0.554833 | from numpy import *
import matplotlib.pyplot as plt
import time
import os
import warnings
warnings.filterwarnings("ignore", category=VisibleDeprecationWarning)
from metalcode_calib_tempe import Teff
from metalcode_calib_tempe import BolCorBV
from metalcode_calib_absmg import absmag
from metalcode_calib_clre... | true | true |
1c326c1be1fa65ae94e336626f666e99c0ffbc37 | 2,281 | py | Python | dialogue-engine/test/programytest/parser/template/graph_tests/test_program.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 104 | 2020-03-30T09:40:00.000Z | 2022-03-06T22:34:25.000Z | dialogue-engine/test/programytest/parser/template/graph_tests/test_program.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 25 | 2020-06-12T01:36:35.000Z | 2022-02-19T07:30:44.000Z | dialogue-engine/test/programytest/parser/template/graph_tests/test_program.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 10 | 2020-04-02T23:43:56.000Z | 2021-05-14T13:47:01.000Z | """
Copyright (c) 2020 COTOBA DESIGN, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distri... | 44.72549 | 126 | 0.737396 | import xml.etree.ElementTree as ET
from programy.parser.template.nodes.base import TemplateNode
from programy.parser.template.nodes.program import TemplateProgramNode
from programy.parser.exceptions import ParserException
from programytest.parser.template.graph_tests.graph_test_client import TemplateGraphTestClient
... | true | true |
1c326c78d52342aca0f9514217bc8d7c8987413f | 685 | py | Python | ynab_sdk/api/accounts.py | csadorf/ynab-sdk-python | 845d3798e44bbc27261f73975089d8e19366e8e8 | [
"Apache-2.0"
] | 19 | 2019-05-04T00:26:31.000Z | 2021-09-01T07:31:20.000Z | ynab_sdk/api/accounts.py | csadorf/ynab-sdk-python | 845d3798e44bbc27261f73975089d8e19366e8e8 | [
"Apache-2.0"
] | 100 | 2019-04-25T00:27:57.000Z | 2022-03-31T15:24:45.000Z | ynab_sdk/api/accounts.py | csadorf/ynab-sdk-python | 845d3798e44bbc27261f73975089d8e19366e8e8 | [
"Apache-2.0"
] | 7 | 2019-11-13T06:30:06.000Z | 2022-03-25T15:37:53.000Z | from ynab_sdk.api.models.responses.account import AccountResponse
from ynab_sdk.api.models.responses.accounts import AccountsResponse
from ynab_sdk.utils.clients.base_client import BaseClient
class AccountsApi:
def __init__(self, client: BaseClient):
self.client = client
def get_accounts(self, budget... | 40.294118 | 81 | 0.753285 | from ynab_sdk.api.models.responses.account import AccountResponse
from ynab_sdk.api.models.responses.accounts import AccountsResponse
from ynab_sdk.utils.clients.base_client import BaseClient
class AccountsApi:
def __init__(self, client: BaseClient):
self.client = client
def get_accounts(self, budget... | true | true |
1c326d2cf6bfa0dfe105f44ccdd7ffff3833f586 | 8,432 | py | Python | Part2/build_model.py | KernelA/ai-lab-test | 3dda3d7879ec77a37fd70be3da8d92cf0a74321c | [
"MIT"
] | null | null | null | Part2/build_model.py | KernelA/ai-lab-test | 3dda3d7879ec77a37fd70be3da8d92cf0a74321c | [
"MIT"
] | null | null | null | Part2/build_model.py | KernelA/ai-lab-test | 3dda3d7879ec77a37fd70be3da8d92cf0a74321c | [
"MIT"
] | null | null | null | import gzip
import json
import logging
import os
import pickle
import re
import string
import unicodedata
import sys
from typing import Dict, Any
from nltk.tokenize import TweetTokenizer
LOGGER = logging.getLogger()
LOGGER.setLevel(logging.DEBUG)
FORMAT = "%(asctime)s %(name)s [%(levelname)s] {%(funcName)s} %(messag... | 35.280335 | 129 | 0.603534 | import gzip
import json
import logging
import os
import pickle
import re
import string
import unicodedata
import sys
from typing import Dict, Any
from nltk.tokenize import TweetTokenizer
LOGGER = logging.getLogger()
LOGGER.setLevel(logging.DEBUG)
FORMAT = "%(asctime)s %(name)s [%(levelname)s] {%(funcName)s} %(messag... | true | true |
1c326d45a20d612aabe7081c9482a2bf8c5d9ead | 377 | py | Python | mainApp/migrations/0008_auto_20191221_1544.py | GauravJain98/Softwars | 10625a90599f834f785a64586bd736dec84fd25b | [
"MIT"
] | null | null | null | mainApp/migrations/0008_auto_20191221_1544.py | GauravJain98/Softwars | 10625a90599f834f785a64586bd736dec84fd25b | [
"MIT"
] | 5 | 2021-03-19T12:47:20.000Z | 2021-09-22T19:42:53.000Z | mainApp/migrations/0008_auto_20191221_1544.py | GauravJain98/Softwars | 10625a90599f834f785a64586bd736dec84fd25b | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2019-12-21 15:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mainApp', '0007_auto_20191215_2009'),
]
operations = [
migrations.RenameField(
model_name='problemstatement',
old_name='youtube... | 20.944444 | 47 | 0.604775 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mainApp', '0007_auto_20191215_2009'),
]
operations = [
migrations.RenameField(
model_name='problemstatement',
old_name='youtube_link',
new_name='youtube',
... | true | true |
1c326e4b8b37ac6f1f9cb4aae8e43bdf93dddc0a | 642 | py | Python | multiProcess/threads/multilock1.py | bruce1408/detectron2_modify | 815df8c3cd68b1450e039fbafc27c6ab302d620b | [
"Apache-2.0"
] | null | null | null | multiProcess/threads/multilock1.py | bruce1408/detectron2_modify | 815df8c3cd68b1450e039fbafc27c6ab302d620b | [
"Apache-2.0"
] | null | null | null | multiProcess/threads/multilock1.py | bruce1408/detectron2_modify | 815df8c3cd68b1450e039fbafc27c6ab302d620b | [
"Apache-2.0"
] | null | null | null | import threading
import time
num = 100
def fun_sub():
global num
lock.acquire()
print('----加锁----')
print('现在操作共享资源的线程名字是:', t.name)
num2 = num
time.sleep(0.001)
num = num2-1
lock.release()
print('----释放锁----')
if __name__ == '__main__':
print('开始测试同步锁 at %s' % time.ctime())... | 18.882353 | 44 | 0.565421 | import threading
import time
num = 100
def fun_sub():
global num
lock.acquire()
print('----加锁----')
print('现在操作共享资源的线程名字是:', t.name)
num2 = num
time.sleep(0.001)
num = num2-1
lock.release()
print('----释放锁----')
if __name__ == '__main__':
print('开始测试同步锁 at %s' % time.ctime())... | true | true |
1c32706216a59ee6d52a4376463befff7c87cc1c | 1,286 | py | Python | test_app.py | MLH-Fellowship/0.5.1-howDoIDiscord | 5bb52e17635f6742dbccd8044435dddd82a3bb93 | [
"MIT"
] | 2 | 2020-06-05T17:31:17.000Z | 2020-06-05T21:32:48.000Z | test_app.py | MLH-Fellowship/0.5.1-howDoIDiscord | 5bb52e17635f6742dbccd8044435dddd82a3bb93 | [
"MIT"
] | 13 | 2020-06-02T15:34:43.000Z | 2020-06-23T23:25:25.000Z | test_app.py | MLH-Fellowship/0.5.1-howDoIDiscord | 5bb52e17635f6742dbccd8044435dddd82a3bb93 | [
"MIT"
] | null | null | null | import pytest
import requests
import json
import urllib.parse
import subprocess
def callHowDoI(testQuery):
# x = requests.post("http://localhost:5000/test", params={"testquery": testQuery})
cmd = "http -f POST http://localhost:5000/test?testquery={}".format(urllib.parse.quote(testQuery))
res = subprocess.c... | 34.756757 | 102 | 0.618974 | import pytest
import requests
import json
import urllib.parse
import subprocess
def callHowDoI(testQuery):
cmd = "http -f POST http://localhost:5000/test?testquery={}".format(urllib.parse.quote(testQuery))
res = subprocess.check_output(cmd, shell=True)
res = res.decode('utf-8')
jsonRes = json... | true | true |
1c3270da277a227601ccd6d01a1407d95545ca58 | 1,842 | py | Python | PygameDeepRLAgent/A3CBootcampGame/ShootingGrounds/Targets.py | Muff1nz/PygameDeepRLAgent | c3e53de99ff847357e27048843ea01fe92fbfd38 | [
"MIT"
] | null | null | null | PygameDeepRLAgent/A3CBootcampGame/ShootingGrounds/Targets.py | Muff1nz/PygameDeepRLAgent | c3e53de99ff847357e27048843ea01fe92fbfd38 | [
"MIT"
] | 4 | 2017-08-25T08:54:05.000Z | 2017-10-26T09:15:18.000Z | PygameDeepRLAgent/A3CBootcampGame/ShootingGrounds/Targets.py | Muff1nz/PygameDeepRLAgent | c3e53de99ff847357e27048843ea01fe92fbfd38 | [
"MIT"
] | 1 | 2019-12-10T01:11:41.000Z | 2019-12-10T01:11:41.000Z | import random
import numpy as np
from A3CBootcampGame.Actor import Actor
class TargetHandler:
def __init__(self, settings, player):
self.settings = settings
self.player = player
self.target = Target(settings, [0,0], "./Assets/Enemy.png")
self.foodSpawnRate = 30
self.spawn... | 28.338462 | 84 | 0.582519 | import random
import numpy as np
from A3CBootcampGame.Actor import Actor
class TargetHandler:
def __init__(self, settings, player):
self.settings = settings
self.player = player
self.target = Target(settings, [0,0], "./Assets/Enemy.png")
self.foodSpawnRate = 30
self.spawn... | true | true |
1c3272ddf3297908c116e0893bea7b92b2baba48 | 743 | py | Python | pzdump.py | kavol/pzdump | 2e7c57a304b7ad2780aff26b26a710634622dfb8 | [
"MIT"
] | null | null | null | pzdump.py | kavol/pzdump | 2e7c57a304b7ad2780aff26b26a710634622dfb8 | [
"MIT"
] | null | null | null | pzdump.py | kavol/pzdump | 2e7c57a304b7ad2780aff26b26a710634622dfb8 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import argparse
import sys
parser = argparse.ArgumentParser(description="A tool to dump timezone data.")
parser.add_argument("-V", "--version", help="output version information and exit",
action="store_true")
parser.add_argument("-v", "--verbose", help="print lowest and highest p... | 35.380952 | 110 | 0.644684 |
import argparse
import sys
parser = argparse.ArgumentParser(description="A tool to dump timezone data.")
parser.add_argument("-V", "--version", help="output version information and exit",
action="store_true")
parser.add_argument("-v", "--verbose", help="print lowest and highest possible time and ... | true | true |
1c32733ec0f61da2f97776ffd0055187cdc56853 | 146 | py | Python | yc66/104.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc66/104.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | yc66/104.py | c-yan/yukicoder | cdbbd65402177225dd989df7fe01f67908484a69 | [
"MIT"
] | null | null | null | S = input()
result = 1
for s in S:
if s == 'L':
result = result * 2
elif s == 'R':
result = result * 2 + 1
print(result)
| 14.6 | 31 | 0.465753 | S = input()
result = 1
for s in S:
if s == 'L':
result = result * 2
elif s == 'R':
result = result * 2 + 1
print(result)
| true | true |
1c3273449f87ead7feafe7ed121958c401918fa7 | 7,903 | py | Python | model.py | haoyu0831/Covid-Mobility-Network-Analysis | 8464b0a25db03585219c1fc6d8e257a9ed826628 | [
"MIT"
] | 1 | 2020-09-23T06:08:20.000Z | 2020-09-23T06:08:20.000Z | model.py | hhe-bot/Covid-Mobility-Network-Analysis | 8464b0a25db03585219c1fc6d8e257a9ed826628 | [
"MIT"
] | 1 | 2020-09-23T06:10:29.000Z | 2020-09-25T15:41:33.000Z | model.py | haoyu0831/Covid-Mobility-Network-Analysis | 8464b0a25db03585219c1fc6d8e257a9ed826628 | [
"MIT"
] | null | null | null | import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
'''
This function is to generate a graph with data produced by read_file.py
'''
def generate_d_network(dest_cbgs):
G = nx.DiGraph()
# add edges
for i in dest_cbgs:
G.add_edge(*i, weight=dest_cbgs[i])
return G
'''
Thi... | 23.520833 | 137 | 0.592307 | import networkx as nx
import numpy as np
import matplotlib.pyplot as plt
def generate_d_network(dest_cbgs):
G = nx.DiGraph()
for i in dest_cbgs:
G.add_edge(*i, weight=dest_cbgs[i])
return G
def generate_network(dest_cbgs):
G = nx.Graph()
for i, j in dest_cbgs.keys():
... | true | true |
1c32746489974f9a1ebb5aee32cae1eeb38fb63b | 2,325 | py | Python | python/expl_impl_euler_optim.py | itpplasma/SIMPLE | 6981791e0a7889647ac5c006325ac951811c2f36 | [
"MIT"
] | 1 | 2020-11-18T14:58:27.000Z | 2020-11-18T14:58:27.000Z | python/expl_impl_euler_optim.py | landreman/SIMPLE | 77722c2479b4a064b99d0e2a58ef7749ce157c07 | [
"MIT"
] | 6 | 2019-10-25T07:52:00.000Z | 2021-11-16T13:19:04.000Z | python/expl_impl_euler_optim.py | landreman/SIMPLE | 77722c2479b4a064b99d0e2a58ef7749ce157c07 | [
"MIT"
] | 2 | 2021-11-05T18:55:09.000Z | 2022-03-23T06:27:04.000Z | """
Created: 2018-08-08
Modified: 2019-03-07
Author: Christopher Albert <albert@alumni.tugraz.at>
"""
from numpy import array, zeros, arange
from scipy.interpolate import lagrange
import common
from common import f, r0, th0, ph0, pph0, timesteps, get_val, get_der2, newton1
from plotting impor... | 29.43038 | 82 | 0.594839 |
from numpy import array, zeros, arange
from scipy.interpolate import lagrange
import common
from common import f, r0, th0, ph0, pph0, timesteps, get_val, get_der2, newton1
from plotting import plot_orbit, plot_cost_function_jac
steps_per_bounce = 8
dt, nt = timesteps(steps_per_bounce, nbounce =... | true | true |
1c3274ff2d683c03bfa991e87a2db167033125f3 | 24,663 | py | Python | sklearn/dummy.py | cperreault11/scikit-learn | 0b78cb00e69109f498c326ad84953954e349d11f | [
"BSD-3-Clause"
] | null | null | null | sklearn/dummy.py | cperreault11/scikit-learn | 0b78cb00e69109f498c326ad84953954e349d11f | [
"BSD-3-Clause"
] | null | null | null | sklearn/dummy.py | cperreault11/scikit-learn | 0b78cb00e69109f498c326ad84953954e349d11f | [
"BSD-3-Clause"
] | null | null | null | # Author: Mathieu Blondel <mathieu@mblondel.org>
# Arnaud Joly <a.joly@ulg.ac.be>
# Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# License: BSD 3 clause
import warnings
import numpy as np
import scipy.sparse as sp
from .base import BaseEstimator, ClassifierMixin, RegressorMixin
from .base impo... | 34.785614 | 88 | 0.575031 |
import warnings
import numpy as np
import scipy.sparse as sp
from .base import BaseEstimator, ClassifierMixin, RegressorMixin
from .base import MultiOutputMixin
from .utils import check_random_state
from .utils import deprecated
from .utils.validation import _num_samples
from .utils.validation import check_array
... | true | true |
1c32751133d80d21b279bcbbf1b75fcc0b098f72 | 461 | py | Python | poco/drivers/std/screen.py | HBoPRC/Poco | c8b0dc5362db45ff7a8397eebb0c52d9047f4b67 | [
"Apache-2.0"
] | null | null | null | poco/drivers/std/screen.py | HBoPRC/Poco | c8b0dc5362db45ff7a8397eebb0c52d9047f4b67 | [
"Apache-2.0"
] | null | null | null | poco/drivers/std/screen.py | HBoPRC/Poco | c8b0dc5362db45ff7a8397eebb0c52d9047f4b67 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
from poco.sdk.interfaces.screen import ScreenInterface
from poco.utils.simplerpc.utils import sync_wrapper
class StdScreen(ScreenInterface):
def __init__(self, client):
super(StdScreen, self).__init__()
self.client = client
@sync_wrapper
def getScreen(self, width):
... | 24.263158 | 54 | 0.707158 |
from poco.sdk.interfaces.screen import ScreenInterface
from poco.utils.simplerpc.utils import sync_wrapper
class StdScreen(ScreenInterface):
def __init__(self, client):
super(StdScreen, self).__init__()
self.client = client
@sync_wrapper
def getScreen(self, width):
return self.c... | true | true |
1c327693cb4b39dc20e869248ee2fa581293cdcd | 214 | py | Python | testing/test.py | matthew-cheney/crowd-sorting-single-threaded | f32f05641821f5770dd95787c459888101b93d05 | [
"MIT"
] | 1 | 2019-11-30T07:59:25.000Z | 2019-11-30T07:59:25.000Z | testing/test.py | mchen95/crowd-sorting | f32f05641821f5770dd95787c459888101b93d05 | [
"MIT"
] | 2 | 2019-10-14T17:16:46.000Z | 2019-10-21T23:14:32.000Z | testing/test.py | matthew-cheney/crowd-sorting-single-threaded | f32f05641821f5770dd95787c459888101b93d05 | [
"MIT"
] | null | null | null | import unittest
class Template(unittest.TestCase):
def setUp(self):
pass
def test_basic(self):
self.assertTrue(True)
self.assertFalse(False)
def tearDown(self):
pass
| 15.285714 | 34 | 0.621495 | import unittest
class Template(unittest.TestCase):
def setUp(self):
pass
def test_basic(self):
self.assertTrue(True)
self.assertFalse(False)
def tearDown(self):
pass
| true | true |
1c327792cbf8c219d3adddc8ebbd0b6ee84b5c8a | 32,170 | py | Python | dqc_testsuite_xule.py | altova/sec-edgar-tools | d9d2e66963d1a357f395fc6b022eee30e4a869c5 | [
"Apache-2.0"
] | 9 | 2015-06-10T15:52:45.000Z | 2022-03-23T20:43:38.000Z | dqc_testsuite_xule.py | altova/sec-edgar-tools | d9d2e66963d1a357f395fc6b022eee30e4a869c5 | [
"Apache-2.0"
] | 2 | 2016-12-02T15:16:34.000Z | 2022-03-23T20:46:27.000Z | dqc_testsuite_xule.py | altova/sec-edgar-tools | d9d2e66963d1a357f395fc6b022eee30e4a869c5 | [
"Apache-2.0"
] | 10 | 2016-03-05T21:16:14.000Z | 2022-02-01T08:58:50.000Z | # Copyright 2015-2018 Altova GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 51.226115 | 223 | 0.666491 |
__copyright__ = 'Copyright 2015-2019 Altova GmbH'
__license__ = 'http://www.apache.org/licenses/LICENSE-2.0'
import argparse
import collections
import concurrent.futures
import datetime
import json
import logging
import multiprocessing
import os
import pickle
import re
import tempfile
imp... | true | true |
1c32782758509d96d470bdcdbadf1eea28c768bf | 1,972 | py | Python | axelrod/game.py | danilobellini/Axelrod | 2c9212553e06095c24adcb82a5979279cbdf45fb | [
"MIT"
] | 1 | 2017-11-29T22:37:35.000Z | 2017-11-29T22:37:35.000Z | axelrod/game.py | danilobellini/Axelrod | 2c9212553e06095c24adcb82a5979279cbdf45fb | [
"MIT"
] | 10 | 2020-09-07T19:44:57.000Z | 2020-11-25T06:00:05.000Z | axelrod/game.py | danilobellini/Axelrod | 2c9212553e06095c24adcb82a5979279cbdf45fb | [
"MIT"
] | null | null | null | from typing import Tuple, Union
from axelrod import Action
C, D = Action.C, Action.D
Score = Union[int, float]
class Game(object):
"""Container for the game matrix and scoring logic.
Attributes
----------
scores: dict
The numerical score attribute to all combinations of action pairs.
"... | 29 | 87 | 0.553245 | from typing import Tuple, Union
from axelrod import Action
C, D = Action.C, Action.D
Score = Union[int, float]
class Game(object):
def __init__(self, r: Score = 3, s: Score = 0, t: Score = 5, p: Score = 1) -> None:
self.scores = {(C, C): (r, r), (D, D): (p, p), (C, D): (s, t), (D, C): (t, s)}
def... | true | true |
1c32785b49c7d09a70abf0156d9432ce96763e30 | 4,103 | py | Python | dask/tests/test_threaded.py | lr4d/dask | e405fa0c767a89ec6a413114be831a96cb388443 | [
"BSD-3-Clause"
] | null | null | null | dask/tests/test_threaded.py | lr4d/dask | e405fa0c767a89ec6a413114be831a96cb388443 | [
"BSD-3-Clause"
] | null | null | null | dask/tests/test_threaded.py | lr4d/dask | e405fa0c767a89ec6a413114be831a96cb388443 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
import signal
import threading
from multiprocessing.pool import ThreadPool
from time import time, sleep
import pytest
import dask
from dask.compatibility import PY2
from dask.threaded import get
from dask.utils_test import inc, add
def test_get():
dsk = {"x": 1, "y": 2, "z": (inc, "x"), "w"... | 23.58046 | 77 | 0.572995 | import os
import sys
import signal
import threading
from multiprocessing.pool import ThreadPool
from time import time, sleep
import pytest
import dask
from dask.compatibility import PY2
from dask.threaded import get
from dask.utils_test import inc, add
def test_get():
dsk = {"x": 1, "y": 2, "z": (inc, "x"), "w"... | true | true |
1c3278aeb432067752f6763a985c005fd4c759c7 | 3,918 | py | Python | src/aws_scatter_gather/s3_sqs_lambda_async_chunked/resources/work_bucket.py | cbuschka/aws-scatter-gather | abebd22aa6449369845a08d4260607745098bb28 | [
"Apache-2.0"
] | 2 | 2020-06-23T08:27:56.000Z | 2020-06-25T08:44:57.000Z | src/aws_scatter_gather/s3_sqs_lambda_async_chunked/resources/work_bucket.py | cbuschka/aws-scatter-gather | abebd22aa6449369845a08d4260607745098bb28 | [
"Apache-2.0"
] | null | null | null | src/aws_scatter_gather/s3_sqs_lambda_async_chunked/resources/work_bucket.py | cbuschka/aws-scatter-gather | abebd22aa6449369845a08d4260607745098bb28 | [
"Apache-2.0"
] | null | null | null | from aws_scatter_gather.util import json
import os
from aws_scatter_gather.util.jsontime import now
from aws_scatter_gather.util.trace import trace
SCOPE = os.environ.get("SCOPE", "")
WORK_BUCKET = "{SCOPE}s3-sqs-lambda-async-chunked-work".format(SCOPE=SCOPE)
async def write_batch_status(batch_id, record_count, ch... | 41.242105 | 98 | 0.662072 | from aws_scatter_gather.util import json
import os
from aws_scatter_gather.util.jsontime import now
from aws_scatter_gather.util.trace import trace
SCOPE = os.environ.get("SCOPE", "")
WORK_BUCKET = "{SCOPE}s3-sqs-lambda-async-chunked-work".format(SCOPE=SCOPE)
async def write_batch_status(batch_id, record_count, ch... | true | true |
1c327a5c34309dbce082e63b1fb494fae4a84f93 | 133 | py | Python | test/tests/vreg_crash.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:28:45.000Z | 2020-02-06T14:28:45.000Z | test/tests/vreg_crash.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | test/tests/vreg_crash.py | jmgc/pyston | 9f672c1bbb75710ac17dd3d9107da05c8e9e8e8f | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:29:00.000Z | 2020-02-06T14:29:00.000Z | def f():
x = 10.0 ** 2
print locals()
# Uncommenting this avoids the crash since we will keep x alive:
# print x
f()
| 19 | 68 | 0.586466 | def f():
x = 10.0 ** 2
print locals()
f()
| false | true |
1c327aabc7e164668a9f2b0263e36d4c77eebdb0 | 1,597 | py | Python | octohatrack/contributors_file.py | ncoghlan/octohatrack | cb7a0e8011a312a9074a2aa63b640c32fdbaa988 | [
"BSD-3-Clause"
] | null | null | null | octohatrack/contributors_file.py | ncoghlan/octohatrack | cb7a0e8011a312a9074a2aa63b640c32fdbaa988 | [
"BSD-3-Clause"
] | null | null | null | octohatrack/contributors_file.py | ncoghlan/octohatrack | cb7a0e8011a312a9074a2aa63b640c32fdbaa988 | [
"BSD-3-Clause"
] | 1 | 2020-12-18T09:13:50.000Z | 2020-12-18T09:13:50.000Z | #############################################################
#
# WARNING
#
# This module is extremely experimental.
#
# May contain traces of:
# * using the GitHub API to pull content of a repo
# * string parsing
# * gluten
#
###################################################... | 27.534483 | 94 | 0.478397 | true | true | |
1c327ac5ec64f945e7fd04b7eb965e6ba822b882 | 4,074 | py | Python | scripts/gen_rf_xmacro_def_undo.py | refu-lang/clib | 327aeea6ed480257c1c4638ba21f2c347f5960ae | [
"MIT",
"BSD-3-Clause"
] | 3 | 2017-02-13T22:31:32.000Z | 2021-07-11T11:59:39.000Z | scripts/gen_rf_xmacro_def_undo.py | refu-lang/clib | 327aeea6ed480257c1c4638ba21f2c347f5960ae | [
"MIT",
"BSD-3-Clause"
] | 1 | 2017-02-06T00:13:05.000Z | 2017-02-06T00:13:05.000Z | scripts/gen_rf_xmacro_def_undo.py | refu-lang/rfbase | 327aeea6ed480257c1c4638ba21f2c347f5960ae | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #the maximum number of arguments for a function
maxArgs = 36
#stuff to import to be able to open files in the parent directory
import os.path
import sys
print("Generating rf_xmacro_def_undo.h ...");
f = open(os.path.dirname(sys.argv[0]) + "/../include/Preprocessor/rf_xmacro_def_undo.h","w");
#put some required def... | 34.235294 | 149 | 0.656112 |
maxArgs = 36
import os.path
import sys
print("Generating rf_xmacro_def_undo.h ...");
f = open(os.path.dirname(sys.argv[0]) + "/../include/Preprocessor/rf_xmacro_def_undo.h","w");
f.write("/**\n** @author Lefteris\n** @date 13/02/2012\n**\n\
** This file contains #undef so to easily undefine all the macros defin... | true | true |
1c327c3b65f8a3b5bc4ad8215b779b5c5535b24b | 19,759 | py | Python | flask_appbuilder/tests/test_mongoengine.py | paulvic/Flask-AppBuilder | 44638156b7ec65e9a77ae474aed75f0de949b505 | [
"BSD-3-Clause"
] | null | null | null | flask_appbuilder/tests/test_mongoengine.py | paulvic/Flask-AppBuilder | 44638156b7ec65e9a77ae474aed75f0de949b505 | [
"BSD-3-Clause"
] | null | null | null | flask_appbuilder/tests/test_mongoengine.py | paulvic/Flask-AppBuilder | 44638156b7ec65e9a77ae474aed75f0de949b505 | [
"BSD-3-Clause"
] | 1 | 2019-09-24T16:23:50.000Z | 2019-09-24T16:23:50.000Z | import datetime
import logging
import os
import random
import string
from flask_appbuilder.charts.views import (
DirectByChartView,
DirectChartView,
GroupByChartView
)
from flask_appbuilder.models.group import aggregate_avg, aggregate_count, aggregate_sum
from flask_appbuilder.models.mongoengine.filters im... | 34.185121 | 88 | 0.582722 | import datetime
import logging
import os
import random
import string
from flask_appbuilder.charts.views import (
DirectByChartView,
DirectChartView,
GroupByChartView
)
from flask_appbuilder.models.group import aggregate_avg, aggregate_count, aggregate_sum
from flask_appbuilder.models.mongoengine.filters im... | true | true |
1c327d42b132530b5c5576706689cbfda1e2995d | 23 | py | Python | irc_bot/__version__.py | gazpachoking/irc_bot | 8dc69386e5e75a0259a32ce4de538c8ff5abea6d | [
"MIT"
] | null | null | null | irc_bot/__version__.py | gazpachoking/irc_bot | 8dc69386e5e75a0259a32ce4de538c8ff5abea6d | [
"MIT"
] | null | null | null | irc_bot/__version__.py | gazpachoking/irc_bot | 8dc69386e5e75a0259a32ce4de538c8ff5abea6d | [
"MIT"
] | null | null | null | __version__ = '1.0.34'
| 11.5 | 22 | 0.652174 | __version__ = '1.0.34'
| true | true |
1c327d96fca9133a54293dca75bf94b325167f62 | 22,647 | py | Python | tests/unit/states/postgres_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 3 | 2015-04-16T18:42:35.000Z | 2017-10-30T16:57:49.000Z | tests/unit/states/postgres_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | tests/unit/states/postgres_test.py | preoctopus/salt | aceaaa0e2f2f2ff29a694393bd82bba0d88fa44d | [
"Apache-2.0"
] | 1 | 2018-04-19T16:57:27.000Z | 2018-04-19T16:57:27.000Z | # -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, Mock, MagicMock, patch
ensure_in_syspath('../../')
# Import ... | 39.317708 | 87 | 0.461915 |
from __future__ import absolute_import
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, Mock, MagicMock, patch
ensure_in_syspath('../../')
from salt.modules import postgres as postgresmod
from salt.states import (
... | true | true |
1c327e79fdd831f32292c1e0db57bf924a41ea04 | 2,937 | py | Python | colored-led-counter/app.py | ceausuveronica/OpenCV-projects | fe9a95eead97212de5afeb59b31a8996ce7fb116 | [
"MIT"
] | null | null | null | colored-led-counter/app.py | ceausuveronica/OpenCV-projects | fe9a95eead97212de5afeb59b31a8996ce7fb116 | [
"MIT"
] | 1 | 2018-06-02T17:58:12.000Z | 2018-06-02T17:58:12.000Z | colored-led-counter/app.py | ceausuveronica/OpenCV-projects | fe9a95eead97212de5afeb59b31a8996ce7fb116 | [
"MIT"
] | null | null | null | # import the necessary packages
import argparse
import numpy as np
from pprint import pprint
try:
from cv2 import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True,
help="path to the input image")
ap.add_argument("-c", "--color",
... | 27.448598 | 105 | 0.630916 |
import argparse
import numpy as np
from pprint import pprint
try:
from cv2 import cv2
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True,
help="path to the input image")
ap.add_argument("-c", "--color",
default="red",
... | true | true |
1c327f0296a46c906815f7847743c4fe97379c29 | 4,433 | py | Python | face_detection_mtcnn_img.py | WhiTExB3AR/PreProduceCode-FMPN-FER | 0273fc08bc86a522525d35fe0826e2f106d16e3e | [
"MIT"
] | null | null | null | face_detection_mtcnn_img.py | WhiTExB3AR/PreProduceCode-FMPN-FER | 0273fc08bc86a522525d35fe0826e2f106d16e3e | [
"MIT"
] | null | null | null | face_detection_mtcnn_img.py | WhiTExB3AR/PreProduceCode-FMPN-FER | 0273fc08bc86a522525d35fe0826e2f106d16e3e | [
"MIT"
] | null | null | null | # https://github.com/ipazc/mtcnn
# USAGE
# python face_detection_mtcnn_img.py --image images\face_detection\team_hlv_tram_anhnguyen_hop.jpg
import argparse
import imutils
# imutils for crop, rotation and resize (also can transition, get edge, plat 3D to 2D and visualize in matplotlib)
# https://github.com/PyImageSear... | 33.839695 | 114 | 0.660501 |
import argparse
import imutils
import cv2
import os
from PIL import Image
from mtcnn import MTCNN
from pathlib import Path
detector = MTCNN()
parser = argparse.ArgumentParser()
parser.add_argument("-img", "--image",
type=str,
required=True,
help="path to input image")
args = vars(parser.parse_... | true | true |
1c327f792bcbb80f4d9b267bc06b4d4888738fc7 | 25,834 | py | Python | saw-remote-api/python/saw_client/crucible.py | GaloisInc/saw-script | d012ffe6bf538456ad19f15974c8367734e45413 | [
"BSD-3-Clause"
] | 411 | 2015-06-09T22:00:47.000Z | 2022-03-30T11:41:23.000Z | saw-remote-api/python/saw_client/crucible.py | GaloisInc/saw-script | d012ffe6bf538456ad19f15974c8367734e45413 | [
"BSD-3-Clause"
] | 1,151 | 2015-06-12T20:46:31.000Z | 2022-03-23T02:56:32.000Z | saw-remote-api/python/saw_client/crucible.py | GaloisInc/saw-script | d012ffe6bf538456ad19f15974c8367734e45413 | [
"BSD-3-Clause"
] | 65 | 2015-06-10T17:52:26.000Z | 2022-02-10T18:17:06.000Z | from abc import ABCMeta, abstractmethod
from cryptol import cryptoltypes
from .utils import deprecated
from dataclasses import dataclass
import dataclasses
import re
from typing import Any, Dict, List, Optional, Set, Union, overload
from typing_extensions import Literal
import inspect
import uuid
from .llvm_type impor... | 38.84812 | 156 | 0.626577 | from abc import ABCMeta, abstractmethod
from cryptol import cryptoltypes
from .utils import deprecated
from dataclasses import dataclass
import dataclasses
import re
from typing import Any, Dict, List, Optional, Set, Union, overload
from typing_extensions import Literal
import inspect
import uuid
from .llvm_type impor... | true | true |
1c327fe199f4fd4dc7cff997cd775b5afdd96687 | 13,546 | py | Python | tests/integration_tests/performance/test_vsock_throughput.py | psalaberria002/firecracker | 86340cb109d7eb1174bb080ef0bcb0aadc80b0f9 | [
"Apache-2.0"
] | 1 | 2020-03-29T00:58:58.000Z | 2020-03-29T00:58:58.000Z | tests/integration_tests/performance/test_vsock_throughput.py | psalaberria002/firecracker | 86340cb109d7eb1174bb080ef0bcb0aadc80b0f9 | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/performance/test_vsock_throughput.py | psalaberria002/firecracker | 86340cb109d7eb1174bb080ef0bcb0aadc80b0f9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests the VSOCK throughput of Firecracker uVMs."""
import os
import json
import logging
import time
import concurrent.futures
import pytest
from conftest import _test_images_s3_bucket
from framework.art... | 38.157746 | 79 | 0.614573 |
import os
import json
import logging
import time
import concurrent.futures
import pytest
from conftest import _test_images_s3_bucket
from framework.artifacts import ArtifactCollection, ArtifactSet
from framework.matrix import TestMatrix, TestContext
from framework.builder import MicrovmBuilder
from framework.stats... | true | true |
1c328000667faa803cdf321cb49c6f78d6edb454 | 2,646 | py | Python | letsencrypt/constants.py | diafygi/letsencrypt | abe1aa999af7b45e28958a7dcdd8fcc0daa310dd | [
"Apache-2.0"
] | 3 | 2019-03-20T08:32:11.000Z | 2021-02-04T13:03:38.000Z | letsencrypt/constants.py | diafygi/letsencrypt | abe1aa999af7b45e28958a7dcdd8fcc0daa310dd | [
"Apache-2.0"
] | null | null | null | letsencrypt/constants.py | diafygi/letsencrypt | abe1aa999af7b45e28958a7dcdd8fcc0daa310dd | [
"Apache-2.0"
] | null | null | null | """Let's Encrypt constants."""
import logging
from acme import challenges
SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins"
"""Setuptools entry point group name for plugins."""
CLI_DEFAULTS = dict(
config_files=["/etc/letsencrypt/cli.ini"],
verbose_count=-(logging.WARNING / 10),
server="https://www... | 27.278351 | 73 | 0.728269 | import logging
from acme import challenges
SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins"
CLI_DEFAULTS = dict(
config_files=["/etc/letsencrypt/cli.ini"],
verbose_count=-(logging.WARNING / 10),
server="https://www.letsencrypt-demo.org/acme/new-reg",
rsa_key_size=2048,
rollback_checkpoints... | true | true |
1c32804e4b4371c9580b161cc812f77631eeb2ff | 105 | py | Python | gunicorn.conf.py | Moustikitos/ark-zen | f02ec0c5565634aaf154c46173572402bf414817 | [
"MIT"
] | 3 | 2018-12-24T09:45:05.000Z | 2020-04-23T09:00:00.000Z | gunicorn.conf.py | Moustikitos/zen | bd11216cd2c891804d6ec4444f9321137b0f54e4 | [
"MIT"
] | 6 | 2018-05-13T13:12:17.000Z | 2018-05-28T19:36:16.000Z | gunicorn.conf.py | Moustikitos/zen | bd11216cd2c891804d6ec4444f9321137b0f54e4 | [
"MIT"
] | 1 | 2018-04-07T12:03:43.000Z | 2018-04-07T12:03:43.000Z | # -*- coding:utf-8 -*-
def post_worker_init(worker):
pass
def on_exit(server):
pass
| 10.5 | 30 | 0.561905 |
def post_worker_init(worker):
pass
def on_exit(server):
pass
| true | true |
1c328154f063336c316c04e0f4be1661f6341130 | 895 | py | Python | part3/webapp/starter/pypi_web_mongodb_s/pypi_web_mongodb/data/mongo_setup.py | israelrico007/build-pypi-mongodb-webcast-series | b5960e2619ba4527e27cdb8e6efd7de2bb6c7448 | [
"MIT"
] | 25 | 2018-05-30T18:03:35.000Z | 2021-11-27T19:03:16.000Z | part3/webapp/starter/pypi_web_mongodb_s/pypi_web_mongodb/data/mongo_setup.py | israelrico007/build-pypi-mongodb-webcast-series | b5960e2619ba4527e27cdb8e6efd7de2bb6c7448 | [
"MIT"
] | 3 | 2018-10-18T11:08:32.000Z | 2019-12-26T16:42:26.000Z | part3/webapp/starter/pypi_web_mongodb_s/pypi_web_mongodb/data/mongo_setup.py | israelrico007/build-pypi-mongodb-webcast-series | b5960e2619ba4527e27cdb8e6efd7de2bb6c7448 | [
"MIT"
] | 10 | 2018-05-30T18:03:49.000Z | 2021-11-27T19:03:19.000Z | import ssl
import mongoengine
def global_init(user=None, password=None, port=27017, server='localhost', use_ssl=True, db_name='pypi_demo'):
if user or password:
if server != 'localhost' and not server.startswith('mongodb+srv://'):
server = 'mongodb+srv://' + server
data = dict(
... | 34.423077 | 109 | 0.597765 | import ssl
import mongoengine
def global_init(user=None, password=None, port=27017, server='localhost', use_ssl=True, db_name='pypi_demo'):
if user or password:
if server != 'localhost' and not server.startswith('mongodb+srv://'):
server = 'mongodb+srv://' + server
data = dict(
... | true | true |
1c328257d3f7cf8f22ac061f8036f5d6e4c832fc | 7,694 | py | Python | is452/routes/insurance_offchain.py | is452-griffininsurance/backend-service | f6d97bad153e7ba705f727e00f18cb027a4c3d3b | [
"MIT"
] | null | null | null | is452/routes/insurance_offchain.py | is452-griffininsurance/backend-service | f6d97bad153e7ba705f727e00f18cb027a4c3d3b | [
"MIT"
] | null | null | null | is452/routes/insurance_offchain.py | is452-griffininsurance/backend-service | f6d97bad153e7ba705f727e00f18cb027a4c3d3b | [
"MIT"
] | null | null | null | from flask import request, jsonify
from is452 import app
from bson.objectid import ObjectId
from pymongo import MongoClient
from datetime import datetime
import json
client = MongoClient("mongodb+srv://is452_admin:mianbaochaoren@is452-project.n0htb.mongodb.net/insurance?retryWrites=true&w=majority")
collection = cli... | 34.044248 | 134 | 0.609566 | from flask import request, jsonify
from is452 import app
from bson.objectid import ObjectId
from pymongo import MongoClient
from datetime import datetime
import json
client = MongoClient("mongodb+srv://is452_admin:mianbaochaoren@is452-project.n0htb.mongodb.net/insurance?retryWrites=true&w=majority")
collection = cli... | true | true |
1c32835832835b2d2505fe59b4541b16a736ed38 | 6,571 | py | Python | scripts/position_data.py | jtmccr1/variant_pipeline | 7376550d8bb90673914845b53b354f87bfd28d5c | [
"Apache-2.0"
] | 11 | 2018-03-29T06:17:50.000Z | 2021-12-16T07:04:57.000Z | scripts/position_data.py | jtmccr1/variant_pipeline | 7376550d8bb90673914845b53b354f87bfd28d5c | [
"Apache-2.0"
] | 7 | 2018-01-05T17:53:14.000Z | 2019-05-09T17:46:18.000Z | scripts/position_data.py | lauringlab/variant_pipeline | b4a26398a5707814884cbf80a2e22032476e6479 | [
"Apache-2.0"
] | 15 | 2017-02-07T21:41:33.000Z | 2021-03-19T07:59:31.000Z | from __future__ import division
import pysam
import numpy as np
import yaml
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
#from scripts.seq_classes import locus, segment, tally, allele # %%
from seq_classes import locus, segment, tally, allele
#from scripts.trim_to_regions import ... | 38.881657 | 129 | 0.569015 | from __future__ import division
import pysam
import numpy as np
import yaml
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
m seq_classes import locus, segment, tally, allele
om trim_to_regions import ReadFASTA
import argparse
import os
import json
def main():
parser = argparse... | true | true |
1c3283d088da48484e2b2afc072a46a997b2b035 | 327 | py | Python | braponto-back/core/migrations/0002_auto_20210223_2124.py | TheRodrigoBraga/Braponto | 8367e5e8fdb1dde192c8068b93c4014d77165785 | [
"MIT"
] | null | null | null | braponto-back/core/migrations/0002_auto_20210223_2124.py | TheRodrigoBraga/Braponto | 8367e5e8fdb1dde192c8068b93c4014d77165785 | [
"MIT"
] | 2 | 2021-02-21T13:39:59.000Z | 2021-02-23T01:52:00.000Z | braponto-back/core/migrations/0002_auto_20210223_2124.py | TheRodrigoBraga/braponto | 8367e5e8fdb1dde192c8068b93c4014d77165785 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-02-24 00:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Funcionarios',
new_name='Funcionario',
),... | 18.166667 | 47 | 0.590214 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Funcionarios',
new_name='Funcionario',
),
]
| true | true |
1c3284f669f39734ab38e65c80681e81e655f75f | 32,613 | py | Python | discovery-infra/tests/base_test.py | rollandf/assisted-test-infra | f2d3411ceb0838f3045e4ad88f2686bed516cf8f | [
"Apache-2.0"
] | null | null | null | discovery-infra/tests/base_test.py | rollandf/assisted-test-infra | f2d3411ceb0838f3045e4ad88f2686bed516cf8f | [
"Apache-2.0"
] | 164 | 2020-11-02T07:02:58.000Z | 2022-03-28T16:03:34.000Z | discovery-infra/tests/base_test.py | rollandf/assisted-test-infra | f2d3411ceb0838f3045e4ad88f2686bed516cf8f | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import shutil
from contextlib import suppress
from pathlib import Path
from typing import Callable, List, Optional, Tuple
import libvirt
from kubernetes.client.exceptions import ApiException as K8sApiException
import pytest
import test_infra.utils as infra_utils
import waiting
from... | 44.071622 | 130 | 0.658296 | import json
import logging
import os
import shutil
from contextlib import suppress
from pathlib import Path
from typing import Callable, List, Optional, Tuple
import libvirt
from kubernetes.client.exceptions import ApiException as K8sApiException
import pytest
import test_infra.utils as infra_utils
import waiting
from... | true | true |
1c32855ce040c09944098b703eb82adf950f3828 | 43 | py | Python | config.py | cbroms/project-archive | 8e7b59b73de2cc3d59f2e302968f6706d2b25e72 | [
"Apache-2.0"
] | null | null | null | config.py | cbroms/project-archive | 8e7b59b73de2cc3d59f2e302968f6706d2b25e72 | [
"Apache-2.0"
] | 1 | 2021-06-28T20:34:30.000Z | 2021-06-28T20:34:30.000Z | config.py | cbroms/project-archive | 8e7b59b73de2cc3d59f2e302968f6706d2b25e72 | [
"Apache-2.0"
] | null | null | null |
PATH_TO_STATIC_FILES = "static/static/"
| 8.6 | 39 | 0.744186 |
PATH_TO_STATIC_FILES = "static/static/"
| true | true |
1c328629c4074fde72880bb57b9d5bba66ca7c6a | 3,437 | py | Python | pytorch/diora/net/outside_index.py | willzhang100/diora | d7d80389eeb3294398d125e451e4158ea0b40eb5 | [
"Apache-2.0"
] | 81 | 2019-03-31T20:16:01.000Z | 2022-02-25T15:39:35.000Z | pytorch/diora/net/outside_index.py | ldzhangyx/diora-for-music-structure | 40b3533e0a181c23cb3d17a65fca528c72813cfb | [
"Apache-2.0"
] | 7 | 2019-04-24T02:33:00.000Z | 2022-01-08T20:49:34.000Z | pytorch/diora/net/outside_index.py | ldzhangyx/diora-for-music-structure | 40b3533e0a181c23cb3d17a65fca528c72813cfb | [
"Apache-2.0"
] | 21 | 2019-04-07T12:37:38.000Z | 2022-03-01T09:18:24.000Z | import torch
from diora.net.offset_cache import get_offset_cache
class OutsideIndex(object):
def get_pairs(self, level, i, n):
"""
Returns all (parent, sibling) coordinate pairs that
are used to construct a node at coordinates
(level, i) where there n leaf nodes.
"""
... | 26.643411 | 69 | 0.495781 | import torch
from diora.net.offset_cache import get_offset_cache
class OutsideIndex(object):
def get_pairs(self, level, i, n):
pairs = []
for level_ in range(level + 1, i + 1):
p_level = level_
p_i = i
s_level = level_ - level - 1
s_i = i - level - ... | true | true |
1c3286a6e08dc9dab868e091995ae78493c7e703 | 11,873 | py | Python | src/backend/api/handlers/team.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | src/backend/api/handlers/team.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | src/backend/api/handlers/team.py | bovlb/the-blue-alliance | 29389649d96fe060688f218d463e642dcebfd6cc | [
"MIT"
] | null | null | null | from typing import Optional
from flask import Response
from backend.api.handlers.decorators import (
api_authenticated,
validate_keys,
)
from backend.api.handlers.helpers.model_properties import (
filter_event_properties,
filter_match_properties,
filter_team_properties,
ModelType,
)
from backe... | 30.44359 | 106 | 0.712541 | from typing import Optional
from flask import Response
from backend.api.handlers.decorators import (
api_authenticated,
validate_keys,
)
from backend.api.handlers.helpers.model_properties import (
filter_event_properties,
filter_match_properties,
filter_team_properties,
ModelType,
)
from backe... | true | true |
1c3287c229049cb1b42b466f18808e837cb06b36 | 41,354 | py | Python | tensorflow/python/distribute/collective_all_reduce_strategy.py | Geolem/tensorflow | cfc9d3e1ba3b50dc66f1b81eaea537772ab16024 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/collective_all_reduce_strategy.py | Geolem/tensorflow | cfc9d3e1ba3b50dc66f1b81eaea537772ab16024 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/collective_all_reduce_strategy.py | Geolem/tensorflow | cfc9d3e1ba3b50dc66f1b81eaea537772ab16024 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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... | 42.241062 | 134 | 0.714683 |
import copy
import threading
import time
import weakref
from tensorflow.core.protobuf import rewriter_config_pb2
from tensorflow.core.protobuf import tensorflow_server_pb2
from tensorflow.python.distribute import collective_util
from tensorflow.python.distribute import cross_device_ops as cross_device_o... | true | true |
1c32884b97603e9760e7db39e37fe69b40866493 | 5,702 | py | Python | alipay/aop/api/domain/InterTradeCompanyConsultOpenApiResult.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/InterTradeCompanyConsultOpenApiResult.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/InterTradeCompanyConsultOpenApiResult.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class InterTradeCompanyConsultOpenApiResult(object):
def __init__(self):
self._belong_group = None
self._cid_list = None
self._mid_list = None
self._name = None
... | 32.033708 | 75 | 0.542967 |
import json
from alipay.aop.api.constant.ParamConstants import *
class InterTradeCompanyConsultOpenApiResult(object):
def __init__(self):
self._belong_group = None
self._cid_list = None
self._mid_list = None
self._name = None
self._ou = None
self._pid_list = Non... | true | true |
1c3289843eccdfc2f96541b9080888251b654cde | 500 | py | Python | arithmetic_op04.py | Mr-Umidjon/Arithmetic_operators | 572027880d929134f1aa58477f4bde00a910454c | [
"MIT"
] | null | null | null | arithmetic_op04.py | Mr-Umidjon/Arithmetic_operators | 572027880d929134f1aa58477f4bde00a910454c | [
"MIT"
] | null | null | null | arithmetic_op04.py | Mr-Umidjon/Arithmetic_operators | 572027880d929134f1aa58477f4bde00a910454c | [
"MIT"
] | null | null | null | # number nomli uch honali butun sonli o’zgaruvchi yarating.
# number o’zgaruvchining birinchi raqamini toping va x1 ga taminlang.
# number o’zgaruvchining ikkinchi raqamini toping va x2 ga taminlang.
# number o’zgaruvchining uchunchi raqamini toping va x3 ga taminlang.
# Ularning yig’indisini answer nomli o’zgaruchiga ... | 23.809524 | 71 | 0.742 |
number = 184
x1 = 184 % 10
number //= 10
x2 = number % 10
number //= 10
x3 = number % 10
number //= 10
answer = x1 + x2 + x3
print(answer)
| true | true |
1c328a667887edc617702bd49f36f391c052d1d2 | 14,439 | py | Python | examples/maze_runner/maze_runner.py | noahhefner/nhefner_pygame_menus | f03d0d0b78d4513d81e80aec08bd7479ff6c62bf | [
"MIT"
] | null | null | null | examples/maze_runner/maze_runner.py | noahhefner/nhefner_pygame_menus | f03d0d0b78d4513d81e80aec08bd7479ff6c62bf | [
"MIT"
] | null | null | null | examples/maze_runner/maze_runner.py | noahhefner/nhefner_pygame_menus | f03d0d0b78d4513d81e80aec08bd7479ff6c62bf | [
"MIT"
] | null | null | null | """
This script shows how to implement a menu system with nhefner_pygame_menus. The
general structure should be laid out as follows:
imports
classes
def main:
game setup stuff here (create players, setup world, etc.)
menu manager stuff here (create manager, buttons, pages, etc.)
while true:
m... | 33.193103 | 109 | 0.557172 | import pygame
import os
from nhefner_pygame_menus import *
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
PURPLE = (255, 0, 255)
class Wall(pygame.sprite.Sprite):
def __init__(self, x, y, width, height, color):
super().__init__()
# ... | true | true |
1c328ae56d56346203a6d125a5f42ea0b98fd624 | 2,135 | py | Python | geoviews/__init__.py | jonmmease/geoviews | ef1424426b82d1674110f2e559ec1a6bcc129326 | [
"BSD-3-Clause"
] | null | null | null | geoviews/__init__.py | jonmmease/geoviews | ef1424426b82d1674110f2e559ec1a6bcc129326 | [
"BSD-3-Clause"
] | null | null | null | geoviews/__init__.py | jonmmease/geoviews | ef1424426b82d1674110f2e559ec1a6bcc129326 | [
"BSD-3-Clause"
] | null | null | null | import param
from holoviews import (extension, help, opts, output, renderer, Store, # noqa (API import)
Cycle, Palette, Overlay, Layout, NdOverlay, NdLayout,
HoloMap, DynamicMap, GridSpace, Dimension, dim)
try:
# Only available in HoloViews >=1.11
from holoviews i... | 46.413043 | 116 | 0.626698 | import param
from holoviews import (extension, help, opts, output, renderer, Store,
Cycle, Palette, Overlay, Layout, NdOverlay, NdLayout,
HoloMap, DynamicMap, GridSpace, Dimension, dim)
try:
from holoviews import render, save
except:
pass
from .element imp... | true | true |
1c328b2e4ae065c1082e8fbbd863543fca6786a7 | 524 | py | Python | phrydy/__init__.py | Josef-Friedrich/phrydy | d89acb06564a387b6e4286b65c00aae61a6316ed | [
"MIT"
] | 6 | 2018-10-05T18:20:18.000Z | 2021-12-14T06:38:46.000Z | phrydy/__init__.py | Josef-Friedrich/phrydy | d89acb06564a387b6e4286b65c00aae61a6316ed | [
"MIT"
] | null | null | null | phrydy/__init__.py | Josef-Friedrich/phrydy | d89acb06564a387b6e4286b65c00aae61a6316ed | [
"MIT"
] | null | null | null | from . import field_docs # noqa: F401
from . import doc_generator # noqa: F401
from . import mediafile_extended # noqa: F401
from ._version import get_versions
from .mediafile_extended import \
MediaFile, \
MediaFileExtended # noqa: F401
from .field_docs import \
fields, \
FieldDocCollection # n... | 22.782609 | 46 | 0.721374 | from . import field_docs
from . import doc_generator
from . import mediafile_extended
from ._version import get_versions
from .mediafile_extended import \
MediaFile, \
MediaFileExtended
from .field_docs import \
fields, \
FieldDocCollection
from .doc_generator import \
get_max_field_le... | true | true |
1c328ba4a136a085fa44642c7e34ce0bed1de999 | 53,828 | py | Python | data/transcoder_evaluation_gfg/python/MOBILE_NUMERIC_KEYPAD_PROBLEM.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/MOBILE_NUMERIC_KEYPAD_PROBLEM.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/MOBILE_NUMERIC_KEYPAD_PROBLEM.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( keypad , n ) :
if ( not keypad or n <= 0 ) :
return 0
if ( n == 1 ) :
return 10
odd = [... | 737.369863 | 10,683 | 0.204447 |
def f_gold ( keypad , n ) :
if ( not keypad or n <= 0 ) :
return 0
if ( n == 1 ) :
return 10
odd = [ 0 ] * 10
even = [ 0 ] * 10
i = 0
j = 0
useOdd = 0
totalCount = 0
for i in range ( 10 ) :
odd [ i ] = 1
for j in range ( 2 , n + 1 ) :
useOdd ... | true | true |
1c328c47f90c2c8cccd9d610252edcd92f1f5310 | 837 | py | Python | exercise/class_game1.py | LeeBeral/python | 9f0d360d69ee5245e3ef13a9dc9fc666374587a4 | [
"MIT"
] | null | null | null | exercise/class_game1.py | LeeBeral/python | 9f0d360d69ee5245e3ef13a9dc9fc666374587a4 | [
"MIT"
] | null | null | null | exercise/class_game1.py | LeeBeral/python | 9f0d360d69ee5245e3ef13a9dc9fc666374587a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import random
def enemy(ancestry,gear):
enemy=ancestry
weapon=gear
hp=random.randrange(0,20)
ac=random.randrange(0,20)
return [enemy,weapon,hp,ac]
def fight(tgt):
print("You take a swing at the " + tgt[0] + ".")
hit=random.randrange(0,20)
if hit > tgt[3]... | 31 | 73 | 0.545998 |
import random
def enemy(ancestry,gear):
enemy=ancestry
weapon=gear
hp=random.randrange(0,20)
ac=random.randrange(0,20)
return [enemy,weapon,hp,ac]
def fight(tgt):
print("You take a swing at the " + tgt[0] + ".")
hit=random.randrange(0,20)
if hit > tgt[3]:
print("You h... | true | true |
1c328ca537430d8d2940418bb3fd2f878a054306 | 239 | py | Python | Exercicios/007-media-aritmetica.py | fernandaveiga/Curso-em-Video | ea8956fce6e16cbaa8a83106ffa45071cbdc617e | [
"MIT"
] | null | null | null | Exercicios/007-media-aritmetica.py | fernandaveiga/Curso-em-Video | ea8956fce6e16cbaa8a83106ffa45071cbdc617e | [
"MIT"
] | null | null | null | Exercicios/007-media-aritmetica.py | fernandaveiga/Curso-em-Video | ea8956fce6e16cbaa8a83106ffa45071cbdc617e | [
"MIT"
] | null | null | null | # 007 - Desenvolva um programa que leia as duas notas de um aluno e calcule e mostre a sua média:
n1 = float(input('Digite a primeira nota: '))
n2 = float(input('Digite a segunda nota: '))
print(f'A médias entre as notas é: {(n1+n2)/2}') | 39.833333 | 97 | 0.694561 |
n1 = float(input('Digite a primeira nota: '))
n2 = float(input('Digite a segunda nota: '))
print(f'A médias entre as notas é: {(n1+n2)/2}') | true | true |
1c328d7d9526bcf4dbafb0a6f872081e9e52f7ef | 1,296 | py | Python | Labs/1/NamingShape.py | ArvinZJC/UofG_PGT_PSD_Python | d90e9bb0b53b14c6b1d7e657c3c61e2792e0d9c4 | [
"MIT"
] | null | null | null | Labs/1/NamingShape.py | ArvinZJC/UofG_PGT_PSD_Python | d90e9bb0b53b14c6b1d7e657c3c61e2792e0d9c4 | [
"MIT"
] | null | null | null | Labs/1/NamingShape.py | ArvinZJC/UofG_PGT_PSD_Python | d90e9bb0b53b14c6b1d7e657c3c61e2792e0d9c4 | [
"MIT"
] | null | null | null | '''
Description: exercise: naming the shape
Version: 1.0.0.20210113
Author: Arvin Zhao
Date: 2021-01-13 11:04:45
Last Editors: Arvin Zhao
LastEditTime: 2021-01-13 11:26:54
'''
def name_shape(slide_num: str, out_of_range_error_msg: str) -> str:
'''
Name a shape according to the number of sldies.
Parameters... | 28.173913 | 153 | 0.631944 |
def name_shape(slide_num: str, out_of_range_error_msg: str) -> str:
shape_namer = {
'3': 'Triangle',
'4': 'Square',
'5': 'Pentagon',
'6': 'Hexagon',
'7': 'Heptagon',
'8': 'Octagon',
'9': 'Enneagon',
'10': 'Decagon'
}
return shape_namer.get(sl... | true | true |
1c328d929a7b5fe0490e67103b0ee806499ee37d | 8,945 | py | Python | module/dun_datasets/additional_gap_loader.py | a07458666/UncertaintyFlow | cef2512901d4e27bb22fc3997522cd47c03b569c | [
"MIT"
] | null | null | null | module/dun_datasets/additional_gap_loader.py | a07458666/UncertaintyFlow | cef2512901d4e27bb22fc3997522cd47c03b569c | [
"MIT"
] | null | null | null | module/dun_datasets/additional_gap_loader.py | a07458666/UncertaintyFlow | cef2512901d4e27bb22fc3997522cd47c03b569c | [
"MIT"
] | null | null | null | import zipfile
import pickle
try:
import urllib
from urllib import urlretrieve
except Exception:
import urllib.request as urllib
from os import path
import numpy as np
from numpy.random import uniform, randn
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
... | 35.496032 | 136 | 0.583007 | import zipfile
import pickle
try:
import urllib
from urllib import urlretrieve
except Exception:
import urllib.request as urllib
from os import path
import numpy as np
from numpy.random import uniform, randn
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
... | true | true |
1c328e4b13a641103c83fd1310687f1abef1d462 | 1,355 | py | Python | image/scripts/blank_image.py | Magnitus-/hypriot-kit | 07941b56411b1f9e7d45a457a3026456ecfc2652 | [
"MIT"
] | 1 | 2018-04-01T21:37:58.000Z | 2018-04-01T21:37:58.000Z | image/scripts/blank_image.py | Magnitus-/hypriot-kit | 07941b56411b1f9e7d45a457a3026456ecfc2652 | [
"MIT"
] | null | null | null | image/scripts/blank_image.py | Magnitus-/hypriot-kit | 07941b56411b1f9e7d45a457a3026456ecfc2652 | [
"MIT"
] | null | null | null | import glob, os
import container
from builder import BuilderBase
class BlankImage(BuilderBase):
repo = 'blank_image'
artifact_pattern = "{device}-raw.img.zip"
artifact_checksum_pattern = "{device}-raw.img.zip.sha256"
def get_description(self):
return "Blank SD Image"
def __init__(self,... | 27.1 | 61 | 0.542435 | import glob, os
import container
from builder import BuilderBase
class BlankImage(BuilderBase):
repo = 'blank_image'
artifact_pattern = "{device}-raw.img.zip"
artifact_checksum_pattern = "{device}-raw.img.zip.sha256"
def get_description(self):
return "Blank SD Image"
def __init__(self,... | true | true |
1c3290b6604a75c73e6c6d0c7728010b0721e2f7 | 13,121 | py | Python | src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_validators.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | 2 | 2020-08-08T11:00:25.000Z | 2020-08-08T11:00:30.000Z | src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_validators.py | cindywu/azure-cli | bd011cb91ac6e0ac89f53e1105d76ea30b6609a0 | [
"MIT"
] | 1 | 2021-06-02T02:49:48.000Z | 2021-06-02T02:49:48.000Z | src/azure-cli/azure/cli/command_modules/storage/tests/hybrid_2019_03_01/test_storage_validators.py | cindywu/azure-cli | bd011cb91ac6e0ac89f53e1105d76ea30b6609a0 | [
"MIT"
] | 1 | 2020-09-07T18:44:14.000Z | 2020-09-07T18:44:14.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 46.200704 | 119 | 0.667099 |
import unittest
import mock
from argparse import Namespace
from six import StringIO
from knack import CLI
from azure.cli.core._config import GLOBAL_CONFIG_DIR, ENV_VAR_PREFIX
from azure.cli.core.cloud import get_active_cloud
from azure.cli.core.profiles import get_sdk, ResourceType, supported_api_version
from a... | true | true |
1c3290d3998f3b680588dcc2763f11f9ba21bd86 | 208 | py | Python | bitmovin/resources/enums/encoder_version.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 44 | 2016-12-12T17:37:23.000Z | 2021-03-03T09:48:48.000Z | bitmovin/resources/enums/encoder_version.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 38 | 2017-01-09T14:45:45.000Z | 2022-02-27T18:04:33.000Z | bitmovin/resources/enums/encoder_version.py | camberbridge/bitmovin-python | 3af4c6e79b0291fda05fd1ceeb5bed1bba9f3c95 | [
"Unlicense"
] | 27 | 2017-02-02T22:49:31.000Z | 2019-11-21T07:04:57.000Z | import enum
class EncoderVersion(enum.Enum):
STABLE = 'STABLE'
BETA = 'BETA'
V0_16_0 = '0.16.0'
V0_17_0 = '0.17.0'
@staticmethod
def default():
return EncoderVersion.STABLE
| 16 | 36 | 0.610577 | import enum
class EncoderVersion(enum.Enum):
STABLE = 'STABLE'
BETA = 'BETA'
V0_16_0 = '0.16.0'
V0_17_0 = '0.17.0'
@staticmethod
def default():
return EncoderVersion.STABLE
| true | true |
1c3290d9b25c6a6853fbf30b5d5f09b7eec27ff6 | 34,256 | py | Python | test/test_utils.py | zoogaezee/youtubeDL | 01de1a9d506ff51bff4100e11275557226fa8b9a | [
"Unlicense"
] | null | null | null | test/test_utils.py | zoogaezee/youtubeDL | 01de1a9d506ff51bff4100e11275557226fa8b9a | [
"Unlicense"
] | null | null | null | test/test_utils.py | zoogaezee/youtubeDL | 01de1a9d506ff51bff4100e11275557226fa8b9a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Various small unit tests
import io
import json
import xml.etree.ElementTree
from youtube_dl.u... | 44.43061 | 157 | 0.607368 |
from __future__ import unicode_literals
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import io
import json
import xml.etree.ElementTree
from youtube_dl.utils import (
age_restricted,
args_to_str,
clean_html,
DateRange,
... | true | true |
1c32910732157fc016e141a31d5d08ae39abdfc7 | 3,797 | py | Python | test/unit/test_callback.py | talkhouli/sockeye | ef5fed26cda3151883efe446878f4d7f65b5852d | [
"Apache-2.0"
] | 1 | 2019-11-14T14:31:07.000Z | 2019-11-14T14:31:07.000Z | test/unit/test_callback.py | talkhouli/sockeye | ef5fed26cda3151883efe446878f4d7f65b5852d | [
"Apache-2.0"
] | null | null | null | test/unit/test_callback.py | talkhouli/sockeye | ef5fed26cda3151883efe446878f4d7f65b5852d | [
"Apache-2.0"
] | 1 | 2019-11-05T14:42:05.000Z | 2019-11-05T14:42:05.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | 44.151163 | 118 | 0.631551 |
import os
import tempfile
import numpy as np
import pytest
from sockeye import callback
from sockeye import constants as C
from sockeye import utils
test_constants = [('perplexity', np.inf,
[{'perplexity': 100.0, '_': 42}, {'perplexity': 50.0}, {'perplexity': 60.0}, {'perplexity': 80.... | true | true |
1c32915066bc8754e129df0f97a3b2fc00012555 | 6,574 | py | Python | _setuputils.py | hackaugusto/gevent | ab5272c5b6fade84ea001f579748898a6d56d5ba | [
"MIT"
] | null | null | null | _setuputils.py | hackaugusto/gevent | ab5272c5b6fade84ea001f579748898a6d56d5ba | [
"MIT"
] | null | null | null | _setuputils.py | hackaugusto/gevent | ab5272c5b6fade84ea001f579748898a6d56d5ba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
gevent build utilities.
"""
from __future__ import print_function, absolute_import, division
import re
import os
import os.path
import sys
from subprocess import check_call
from glob import glob
from setuptools import Extension as _Extension
from setuptools.command.build_ext import build_... | 29.479821 | 135 | 0.634773 |
from __future__ import print_function, absolute_import, division
import re
import os
import os.path
import sys
from subprocess import check_call
from glob import glob
from setuptools import Extension as _Extension
from setuptools.command.build_ext import build_ext
py_version_info')
WIN = sys.platform.startswith('... | true | true |
1c32921f448fde06c33182baa152d1c193fd83fc | 819 | py | Python | Problems/seven_sided_die.py | rohanaurora/daily-coding-challenges | a40340e5a4f15a5f7b66a64f98dc149a66ebd945 | [
"MIT"
] | null | null | null | Problems/seven_sided_die.py | rohanaurora/daily-coding-challenges | a40340e5a4f15a5f7b66a64f98dc149a66ebd945 | [
"MIT"
] | null | null | null | Problems/seven_sided_die.py | rohanaurora/daily-coding-challenges | a40340e5a4f15a5f7b66a64f98dc149a66ebd945 | [
"MIT"
] | null | null | null | # Seven-sided dice from five-sided dice
#
# Given an equal-probability generator of one of the integers 1 to 5 as dice5, create dice7 that generates a
# pseudo-random integer from 1 to 7 in equal probability using only dice5 as a source of random numbers,
# and check the distribution for at least one million calls usin... | 32.76 | 110 | 0.716728 |
from random import randint
def dice5():
return randint(1, 5)
def dice7():
r = dice5() + dice5() * 5 - 6
if r < 21:
return (r % 7) + 1
else:
return dice7()
s = dice7()
print(s) | true | true |
1c329252ff1f3f27a711b8961b57e678169c29da | 2,720 | py | Python | grism_analysis_main.py | WWGolay/grism-gui | 1c689b622724c1bd6afc73d40d197366e86d7bb2 | [
"MIT"
] | null | null | null | grism_analysis_main.py | WWGolay/grism-gui | 1c689b622724c1bd6afc73d40d197366e86d7bb2 | [
"MIT"
] | null | null | null | grism_analysis_main.py | WWGolay/grism-gui | 1c689b622724c1bd6afc73d40d197366e86d7bb2 | [
"MIT"
] | null | null | null | '''
grism_analysis_main
Last Updated 5/2/22
University Of Iowa Astronomy Department
AJ Serck
Will Golay
'''
# Python imports
from datetime import date, timedelta, datetime
import astropy.io.fits as pyfits
import os
# Custom libraries
from bin.grism_analysis_web import grism_web
from bin.grism_tools_lib import grism_... | 39.42029 | 136 | 0.640441 |
from datetime import date, timedelta, datetime
import astropy.io.fits as pyfits
import os
from bin.grism_analysis_web import grism_web
from bin.grism_tools_lib import grism_tools
from config import setup_config
def main():
cfg = setup_config.read('grism-gui.cfg')
default_temp_dir = cfg.get('default', 'defa... | true | true |
1c3292b7fa0d90db80e2778bb80e56558ce08540 | 2,035 | py | Python | frappe/commands/redis_utils.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/commands/redis_utils.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/commands/redis_utils.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | import os
import click
import frappe
from frappe.installer import update_site_config
from frappe.utils.redis_queue import RedisQueue
@click.command("create-rq-users")
@click.option(
"--set-admin-password",
is_flag=True,
default=False,
help="Set new Redis admin(default user) password",
)
@click.option(
"--use-r... | 27.5 | 93 | 0.747912 | import os
import click
import frappe
from frappe.installer import update_site_config
from frappe.utils.redis_queue import RedisQueue
@click.command("create-rq-users")
@click.option(
"--set-admin-password",
is_flag=True,
default=False,
help="Set new Redis admin(default user) password",
)
@click.option(
"--use-r... | true | true |
1c3294341dafd442f43d58b91e40f15dec483b03 | 167 | py | Python | neuro_helper/abstract/__init__.py | mehrshadg/neuro-data-helper | 7a17ae7e4cca1a5652c9c0182c209b084073cf1f | [
"MIT"
] | null | null | null | neuro_helper/abstract/__init__.py | mehrshadg/neuro-data-helper | 7a17ae7e4cca1a5652c9c0182c209b084073cf1f | [
"MIT"
] | null | null | null | neuro_helper/abstract/__init__.py | mehrshadg/neuro-data-helper | 7a17ae7e4cca1a5652c9c0182c209b084073cf1f | [
"MIT"
] | null | null | null | from .map import *
__all__ = ["Space", "TopoName", "TemplateName", "HierarchyName", "TemplateData",
"AbstractMap", "TemplateMap", "TopoMap", "file_names"]
| 33.4 | 80 | 0.652695 | from .map import *
__all__ = ["Space", "TopoName", "TemplateName", "HierarchyName", "TemplateData",
"AbstractMap", "TemplateMap", "TopoMap", "file_names"]
| true | true |
1c3294680cf5595fc4436eeac807d9840ea677b4 | 3,448 | py | Python | python/smqtk/bin/minibatch_kmeans_clusters.py | jbeezley/SMQTK | e6b00f94be95f39bbca52a7983ac3d6d1f86f847 | [
"BSD-3-Clause"
] | 1 | 2021-04-10T10:51:26.000Z | 2021-04-10T10:51:26.000Z | python/smqtk/bin/minibatch_kmeans_clusters.py | jbeezley/SMQTK | e6b00f94be95f39bbca52a7983ac3d6d1f86f847 | [
"BSD-3-Clause"
] | 3 | 2021-06-08T22:19:14.000Z | 2022-03-12T00:46:44.000Z | python/smqtk/bin/minibatch_kmeans_clusters.py | DigitalCompanion/SMQTK | fc9404b69150ef44f24423844bc80735c0c2b669 | [
"BSD-3-Clause"
] | null | null | null | """
Script for generating clusters from descriptors in a given index using the
mini-batch KMeans implementation from Scikit-learn
(http://scikit-learn.org/stable/modules/generated/sklearn.cluster.MiniBatchKMeans.html).
By the nature of Scikit-learn's MiniBatchKMeans implementation, euclidean
distance is used to measur... | 35.546392 | 88 | 0.710847 | import logging
import os
import numpy
from six.moves import cPickle
from sklearn.cluster import MiniBatchKMeans
from smqtk.compute_functions import mb_kmeans_build_apply
from smqtk.representation.descriptor_index import get_descriptor_index_impls
from smqtk.utils import Configurable
from smqtk.utils.bin_utils import ... | true | true |
1c3294df2c05ca1b567ad8b831cd7b9923bea59b | 5,032 | py | Python | venv/lib/python3.7/site-packages/rinoh/font/opentype/gsub.py | rodrez/jobpy | 02da7ed62a5f057ce66f7b3c0a5f13223363af9a | [
"MIT"
] | 3 | 2020-05-16T01:54:47.000Z | 2021-04-27T01:37:08.000Z | venv/lib/python3.7/site-packages/rinoh/font/opentype/gsub.py | rodrez/jobpy | 02da7ed62a5f057ce66f7b3c0a5f13223363af9a | [
"MIT"
] | 7 | 2020-05-11T01:45:45.000Z | 2022-03-02T14:58:30.000Z | venv/lib/python3.7/site-packages/rinoh/font/opentype/gsub.py | rodrez/jobpy | 02da7ed62a5f057ce66f7b3c0a5f13223363af9a | [
"MIT"
] | 1 | 2020-07-19T04:31:01.000Z | 2020-07-19T04:31:01.000Z | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from .parse import OpenTypeTable, MultiFormatTable
from ... | 34.703448 | 80 | 0.61566 |
from .parse import OpenTypeTable, MultiFormatTable
from .parse import uint16, ushort, ulong, glyph_id, array, indirect
from .parse import context_array, indirect_array
from .layout import LayoutTable
from .layout import Coverage
class SingleSubTable(MultiFormatTable):
entries = [('SubstFormat', uint16),
... | true | true |
1c32955b469aa7291af353410301fd056959674e | 37,823 | py | Python | tests/commands/train_test.py | OhadRubin/allennlp | 7e61241d2720050d0f39376eebba713acd0b287b | [
"Apache-2.0"
] | null | null | null | tests/commands/train_test.py | OhadRubin/allennlp | 7e61241d2720050d0f39376eebba713acd0b287b | [
"Apache-2.0"
] | 35 | 2021-08-11T13:20:30.000Z | 2022-03-29T13:17:39.000Z | tests/commands/train_test.py | OhadRubin/allennlp | 7e61241d2720050d0f39376eebba713acd0b287b | [
"Apache-2.0"
] | null | null | null | import argparse
import copy
import json
import logging
import math
import os
import re
import shutil
from collections import OrderedDict, Counter
from typing import Optional, List, Dict, Any
import pytest
import torch
from allennlp.commands.train import Train, train_model, train_model_from_args, TrainModel
from alle... | 40.626208 | 107 | 0.584829 | import argparse
import copy
import json
import logging
import math
import os
import re
import shutil
from collections import OrderedDict, Counter
from typing import Optional, List, Dict, Any
import pytest
import torch
from allennlp.commands.train import Train, train_model, train_model_from_args, TrainModel
from alle... | true | true |
1c32983c9fd1009fd780c6074a40829ed2e5320b | 10,682 | py | Python | SpiderKeeper/app/spider/model.py | huichen90/SpiderKeeper | 9b9fdb56c87da7734b9dce2e63adc0e97c201c57 | [
"MIT"
] | null | null | null | SpiderKeeper/app/spider/model.py | huichen90/SpiderKeeper | 9b9fdb56c87da7734b9dce2e63adc0e97c201c57 | [
"MIT"
] | null | null | null | SpiderKeeper/app/spider/model.py | huichen90/SpiderKeeper | 9b9fdb56c87da7734b9dce2e63adc0e97c201c57 | [
"MIT"
] | null | null | null | import datetime
from sqlalchemy import desc
from SpiderKeeper.app import db, Base
class Project(Base):
__tablename__ = 'sk_project'
'''创建的工程表'''
project_name = db.Column(db.String(50))
@classmethod
def load_project(cls, project_list): # 添加工程
for project in project_list:
exis... | 42.899598 | 111 | 0.627691 | import datetime
from sqlalchemy import desc
from SpiderKeeper.app import db, Base
class Project(Base):
__tablename__ = 'sk_project'
project_name = db.Column(db.String(50))
@classmethod
def load_project(cls, project_list):
for project in project_list:
existed_project = cls.query... | true | true |
1c3298ce7a8f61c528dabe303770da0032e2cd4a | 196 | py | Python | bot/hooks/__init__.py | lungdart/discord_rpg_bot | dc574026965b972c6935cca0db2679e7be757939 | [
"MIT"
] | 1 | 2021-03-01T22:20:33.000Z | 2021-03-01T22:20:33.000Z | bot/hooks/__init__.py | lungdart/discord_rpg_bot | dc574026965b972c6935cca0db2679e7be757939 | [
"MIT"
] | 17 | 2021-03-05T16:50:48.000Z | 2021-03-18T17:49:47.000Z | bot/hooks/__init__.py | lungdart/discord_rpg_bot | dc574026965b972c6935cca0db2679e7be757939 | [
"MIT"
] | null | null | null | from bot.hooks.admin import Admin
from bot.hooks.battle import Battle
from bot.hooks.manage_char import ManageCharacter
from bot.hooks.activities import Activities
from bot.hooks.shop import Shop
| 32.666667 | 49 | 0.846939 | from bot.hooks.admin import Admin
from bot.hooks.battle import Battle
from bot.hooks.manage_char import ManageCharacter
from bot.hooks.activities import Activities
from bot.hooks.shop import Shop
| true | true |
1c329a5bd7c432f41175cac631c67f134572022d | 938 | py | Python | swiftwind/core/templatetags/swiftwind_utilities.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 11 | 2016-12-13T00:46:48.000Z | 2020-07-28T13:44:12.000Z | swiftwind/core/templatetags/swiftwind_utilities.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 15 | 2017-11-29T19:38:32.000Z | 2018-11-02T21:08:04.000Z | swiftwind/core/templatetags/swiftwind_utilities.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 4 | 2018-10-23T12:39:04.000Z | 2019-12-30T11:06:23.000Z | import six
from django import template
register = template.Library()
@register.filter
def partition(list_, columns=2):
"""
Break a list into ``columns`` number of columns.
"""
iter_ = iter(list_)
columns = int(columns)
rows = []
while True:
row = []
for column_number in ... | 20.844444 | 52 | 0.50533 | import six
from django import template
register = template.Library()
@register.filter
def partition(list_, columns=2):
iter_ = iter(list_)
columns = int(columns)
rows = []
while True:
row = []
for column_number in range(1, columns + 1):
try:
value = six.n... | true | true |
1c329a8a741053888ca17662e28135f888beecd4 | 648 | py | Python | backend/app/alembic/versions/a9c131191819_add_notes_file.py | dmitritruf/distiller-django-react | ec4c3837194306e725d8a2437ace10a899a254d2 | [
"BSD-3-Clause"
] | 2 | 2021-11-04T16:27:33.000Z | 2021-11-04T20:09:19.000Z | backend/app/alembic/versions/a9c131191819_add_notes_file.py | OpenChemistry/distiller | 67da87672654555f9821590f42b108d70a55c1a6 | [
"BSD-3-Clause"
] | 70 | 2021-11-04T16:34:52.000Z | 2022-03-30T02:52:17.000Z | backend/app/alembic/versions/a9c131191819_add_notes_file.py | dmitritruf/distiller-django-react | ec4c3837194306e725d8a2437ace10a899a254d2 | [
"BSD-3-Clause"
] | null | null | null | """Add notes file
Revision ID: a9c131191819
Revises: 6c7e28cf38e9
Create Date: 2021-08-13 10:38:45.529535
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'a9c131191819'
down_revision = '6c7e28cf38e9'
branch_labels = None
depends_on = None
def upgrade():
#... | 22.344828 | 74 | 0.686728 | from alembic import op
import sqlalchemy as sa
revision = 'a9c131191819'
down_revision = '6c7e28cf38e9'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
1c329b19455a566b39ba5de47c0f2d1dcab07ece | 28,779 | py | Python | tests/wallet/simple_sync/test_simple_sync_protocol.py | zcomputerwiz/hddcoin-light-wallet | cf059817fff9753ce4b499edefc4deb39703248c | [
"Apache-2.0"
] | null | null | null | tests/wallet/simple_sync/test_simple_sync_protocol.py | zcomputerwiz/hddcoin-light-wallet | cf059817fff9753ce4b499edefc4deb39703248c | [
"Apache-2.0"
] | null | null | null | tests/wallet/simple_sync/test_simple_sync_protocol.py | zcomputerwiz/hddcoin-light-wallet | cf059817fff9753ce4b499edefc4deb39703248c | [
"Apache-2.0"
] | null | null | null | # flake8: noqa: F811, F401
import asyncio
from typing import List, Optional
import pytest
from clvm.casts import int_to_bytes
from colorlog import logging
from hddcoin.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward
from hddcoin.protocols import wallet_protocol, full_node_protocol
f... | 45.536392 | 118 | 0.710136 |
import asyncio
from typing import List, Optional
import pytest
from clvm.casts import int_to_bytes
from colorlog import logging
from hddcoin.consensus.block_rewards import calculate_pool_reward, calculate_base_farmer_reward
from hddcoin.protocols import wallet_protocol, full_node_protocol
from hddcoin.protocols.full... | true | true |
1c329c6a37fddc5fbee797a6ee3d3ba3ea359df3 | 2,768 | py | Python | models/encoder.py | zsc/End-to-end-ASR-Transformer | 3e02ff6210badb588134a81eb17f8c9ab59e735f | [
"Apache-2.0"
] | 7 | 2021-12-08T04:07:48.000Z | 2022-01-10T07:27:29.000Z | models/encoder.py | zsc/End-to-end-ASR-Transformer | 3e02ff6210badb588134a81eb17f8c9ab59e735f | [
"Apache-2.0"
] | 1 | 2021-12-08T05:14:47.000Z | 2021-12-08T05:14:47.000Z | models/encoder.py | zsc/End-to-end-ASR-Transformer | 3e02ff6210badb588134a81eb17f8c9ab59e735f | [
"Apache-2.0"
] | 1 | 2021-12-08T05:13:44.000Z | 2021-12-08T05:13:44.000Z | import megengine.module as M
import megengine.functional as F
import megengine as mge
from .attention import MultiHeadedAttention
from .embedding import PositionalEncoding
from .encoder_layer import EncoderLayer
from .layer_norm import LayerNorm
from .positionwise_feed_forward import PositionwiseFeedForward
from .repea... | 32.564706 | 81 | 0.616329 | import megengine.module as M
import megengine.functional as F
import megengine as mge
from .attention import MultiHeadedAttention
from .embedding import PositionalEncoding
from .encoder_layer import EncoderLayer
from .layer_norm import LayerNorm
from .positionwise_feed_forward import PositionwiseFeedForward
from .repea... | true | true |
1c329ca24197b85d788b41f05cb3ae0f8b488d05 | 13,350 | py | Python | code/train_seq2seq.py | sumanbanerjee1/Code-Mixed-Dialog | 9df1d4dc800548a883f8bc1a9ce4116c77aebc02 | [
"Apache-2.0"
] | 35 | 2018-06-27T11:07:58.000Z | 2022-01-06T07:52:35.000Z | code/train_seq2seq.py | sumanbanerjee1/Code-Mixed-Dialog | 9df1d4dc800548a883f8bc1a9ce4116c77aebc02 | [
"Apache-2.0"
] | null | null | null | code/train_seq2seq.py | sumanbanerjee1/Code-Mixed-Dialog | 9df1d4dc800548a883f8bc1a9ce4116c77aebc02 | [
"Apache-2.0"
] | 6 | 2019-06-30T07:13:59.000Z | 2021-02-17T13:14:52.000Z | import tensorflow as tf
import numpy as np
import json
import pickle
import os
import subprocess
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from tqdm import tqdm
from seq2seq.model import Seq2seqModel
from seq2seq.data_utils import pad, replace_token_no, get_len
flags = tf.app.flags
flags.DEFI... | 32.402913 | 112 | 0.630412 | import tensorflow as tf
import numpy as np
import json
import pickle
import os
import subprocess
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from tqdm import tqdm
from seq2seq.model import Seq2seqModel
from seq2seq.data_utils import pad, replace_token_no, get_len
flags = tf.app.flags
flags.DEFI... | true | true |
1c329d8afed0fdcc1edf83c27cb2d8f18395ae5d | 5,367 | py | Python | violas_client/canoser/int_type.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/canoser/int_type.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/canoser/int_type.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | import struct
from random import randint
from violas_client.canoser.base import Base
from struct import pack, unpack
from_bytes = int.from_bytes
class IntType(Base):
@classmethod
def to_json_serializable(cls, value):
return value
@classmethod
def encode(cls, value):
retu... | 25.679426 | 90 | 0.575182 | import struct
from random import randint
from violas_client.canoser.base import Base
from struct import pack, unpack
from_bytes = int.from_bytes
class IntType(Base):
@classmethod
def to_json_serializable(cls, value):
return value
@classmethod
def encode(cls, value):
retu... | true | true |
1c329db3107c5e67b900cf9359ac76186cdfbe1f | 3,680 | py | Python | awacs/glue.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | awacs/glue.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | awacs/glue.py | chizou/awacs | 335c545d13ea22488b318245af891eb427c139db | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'AWS Glue'
prefix = 'glue'
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Action, self)
... | 37.171717 | 70 | 0.787228 |
from aws import Action as BaseAction
from aws import BaseARN
service_name = 'AWS Glue'
prefix = 'glue'
class Action(BaseAction):
def __init__(self, action=None):
sup = super(Action, self)
sup.__init__(prefix, action)
class ARN(BaseARN):
def __init__(self, resource='', region='', accoun... | true | true |
1c329e24df8c7d20f6476811b5648b3433fdb945 | 2,084 | py | Python | ietf/person/migrations/0012_auto_20160606_0823.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-11-20T03:40:40.000Z | 2021-11-20T03:40:42.000Z | ietf/person/migrations/0012_auto_20160606_0823.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/person/migrations/0012_auto_20160606_0823.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import ietf.utils.storage
class Migration(migrations.Migration):
dependencies = [
('person', '0011_populate_photos'),
]
operations = [
migrations.AlterField(
model_name='... | 40.076923 | 163 | 0.647793 |
from __future__ import unicode_literals
from django.db import models, migrations
import ietf.utils.storage
class Migration(migrations.Migration):
dependencies = [
('person', '0011_populate_photos'),
]
operations = [
migrations.AlterField(
model_name='person',
na... | true | true |
1c329e4cf35061eb113f0ddacf52c789c39ee2c8 | 1,205 | py | Python | bigfastapi/schemas/customer_schemas.py | Smyja/bigfastapi | b05beede7bb8e853ce0494b495379037ccf27e8d | [
"MIT"
] | null | null | null | bigfastapi/schemas/customer_schemas.py | Smyja/bigfastapi | b05beede7bb8e853ce0494b495379037ccf27e8d | [
"MIT"
] | null | null | null | bigfastapi/schemas/customer_schemas.py | Smyja/bigfastapi | b05beede7bb8e853ce0494b495379037ccf27e8d | [
"MIT"
] | null | null | null | from datetime import datetime
from typing import Optional
from pydantic import BaseModel, EmailStr
class CustomerBase(BaseModel):
first_name: str
last_name: str
email: EmailStr
phone_number: str
address: str
gender: str
age: int
postal_code: str
language: str
country: str
ci... | 23.173077 | 41 | 0.696266 | from datetime import datetime
from typing import Optional
from pydantic import BaseModel, EmailStr
class CustomerBase(BaseModel):
first_name: str
last_name: str
email: EmailStr
phone_number: str
address: str
gender: str
age: int
postal_code: str
language: str
country: str
ci... | true | true |
1c329ea00c456aad992839207eb9b262d8114035 | 1,080 | py | Python | walktilldestination.py | collaborative-robotics/behavior3py | d65ec781a1fefde7ad8f6c4369833054da312a7e | [
"MIT"
] | 2 | 2020-12-02T22:56:45.000Z | 2021-01-14T21:22:55.000Z | walktilldestination.py | collaborative-robotics/behavior3py | d65ec781a1fefde7ad8f6c4369833054da312a7e | [
"MIT"
] | null | null | null | walktilldestination.py | collaborative-robotics/behavior3py | d65ec781a1fefde7ad8f6c4369833054da312a7e | [
"MIT"
] | 1 | 2020-12-02T22:56:49.000Z | 2020-12-02T22:56:49.000Z | import b3
__all__ = ['WalkTillDestination']
class WalkTillDestination(b3.Decorator):
def __init__(self, child, max_loop=-1):
super(RepeatUntilSuccess, self).__init__(child)
self.max_loop = max_loop
def open(self, tick):
tick.blackboard.set('i', 0, tick.tree.id, self.id)
tick.... | 27.692308 | 85 | 0.559259 | import b3
__all__ = ['WalkTillDestination']
class WalkTillDestination(b3.Decorator):
def __init__(self, child, max_loop=-1):
super(RepeatUntilSuccess, self).__init__(child)
self.max_loop = max_loop
def open(self, tick):
tick.blackboard.set('i', 0, tick.tree.id, self.id)
tick.... | false | true |
1c329f4762f4785e737cff46b09c8e9f80c61634 | 6,162 | py | Python | FeaturesSP500.py | LaplaceKorea/Data | 8c16fc8c4cc29c1dc42d340ba1452c7fbc222bd3 | [
"MIT"
] | null | null | null | FeaturesSP500.py | LaplaceKorea/Data | 8c16fc8c4cc29c1dc42d340ba1452c7fbc222bd3 | [
"MIT"
] | null | null | null | FeaturesSP500.py | LaplaceKorea/Data | 8c16fc8c4cc29c1dc42d340ba1452c7fbc222bd3 | [
"MIT"
] | null | null | null |
from typing import Any, Dict, List, Tuple
from Config import cfg
from Features import *
import numpy as np
DELAYED_BID = 66
DELAYED_ASK = 67
DELAYED_LAST = 68
DELAYED_BID_SIZE = 69
DELAYED_ASK_SIZE = 70
DELAYED_LAST_SIZE = 71
DELAYED_HIGH = 72
DELAYED_LOW = 73
DELAYED_VOLUME = 74
DELAYED_CLOSE = 75
DELAYED_OPEN = 76
... | 26.908297 | 104 | 0.499675 |
from typing import Any, Dict, List, Tuple
from Config import cfg
from Features import *
import numpy as np
DELAYED_BID = 66
DELAYED_ASK = 67
DELAYED_LAST = 68
DELAYED_BID_SIZE = 69
DELAYED_ASK_SIZE = 70
DELAYED_LAST_SIZE = 71
DELAYED_HIGH = 72
DELAYED_LOW = 73
DELAYED_VOLUME = 74
DELAYED_CLOSE = 75
DELAYED_OPEN = 76
... | true | true |
1c32a1c327da3427def2508fea5d64478b4d53ed | 9,153 | py | Python | utils/data/config.py | Chen-Yifan/weaver | 431a1427a185fa6357e40b729b8adcf263c349d2 | [
"MIT"
] | null | null | null | utils/data/config.py | Chen-Yifan/weaver | 431a1427a185fa6357e40b729b8adcf263c349d2 | [
"MIT"
] | null | null | null | utils/data/config.py | Chen-Yifan/weaver | 431a1427a185fa6357e40b729b8adcf263c349d2 | [
"MIT"
] | 2 | 2021-03-06T00:57:04.000Z | 2021-05-15T05:16:03.000Z | import numpy as np
import yaml
import copy
from ..logger import _logger
from .tools import _get_variable_names
def _as_list(x):
if x is None:
return None
elif isinstance(x, (list, tuple)):
return x
else:
return [x]
def _md5(fname):
'''https://stackoverflow.com/questions/3431... | 42.771028 | 162 | 0.567136 | import numpy as np
import yaml
import copy
from ..logger import _logger
from .tools import _get_variable_names
def _as_list(x):
if x is None:
return None
elif isinstance(x, (list, tuple)):
return x
else:
return [x]
def _md5(fname):
import hashlib
hash_md5 = hashlib.md5()... | true | true |
1c32a23cb2cdd2fe2ed6a06239d902692c93ac99 | 3,800 | py | Python | noxfile.py | oertr/hypermodern-python | 5c792d42577692d28df45a981948d774442f63d8 | [
"MIT"
] | null | null | null | noxfile.py | oertr/hypermodern-python | 5c792d42577692d28df45a981948d774442f63d8 | [
"MIT"
] | 1 | 2021-11-24T09:58:54.000Z | 2021-11-24T09:58:54.000Z | noxfile.py | oertr/hypermodern-python | 5c792d42577692d28df45a981948d774442f63d8 | [
"MIT"
] | null | null | null | """Nox sessions."""
import tempfile
from typing import Any
import nox
from nox.sessions import Session
nox.options.sessions = "lint", "mypy", "tests"
locations = "src", "tests", "noxfile.py", "docs/conf.py"
def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> None:
"""Install packages co... | 30.645161 | 86 | 0.619474 | import tempfile
from typing import Any
import nox
from nox.sessions import Session
nox.options.sessions = "lint", "mypy", "tests"
locations = "src", "tests", "noxfile.py", "docs/conf.py"
def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> None:
with tempfile.NamedTemporaryFile() as requ... | true | true |
1c32a283e9321b6fee30f4acfd6dc10a11a36b5c | 155 | py | Python | polls_cms_integration/forms.py | sandilukez/news-project | fcd91edd6b7d6941b77a6390aa86efe3e2b0c3a1 | [
"MIT"
] | null | null | null | polls_cms_integration/forms.py | sandilukez/news-project | fcd91edd6b7d6941b77a6390aa86efe3e2b0c3a1 | [
"MIT"
] | null | null | null | polls_cms_integration/forms.py | sandilukez/news-project | fcd91edd6b7d6941b77a6390aa86efe3e2b0c3a1 | [
"MIT"
] | null | null | null | from django import forms
from polls.models import Poll
class PollWizardForm(forms.ModelForm):
class Meta:
model = Poll
exclude = []
| 15.5 | 38 | 0.670968 | from django import forms
from polls.models import Poll
class PollWizardForm(forms.ModelForm):
class Meta:
model = Poll
exclude = []
| true | true |
1c32a3d1b74ff3ab9282c97dbdf86760f4c701ba | 2,993 | py | Python | setup.py | bchretien/bloom | 51b12507745521989944730f1c6b8539e26a7406 | [
"BSD-3-Clause"
] | 1 | 2016-03-09T00:27:38.000Z | 2016-03-09T00:27:38.000Z | setup.py | bchretien/bloom | 51b12507745521989944730f1c6b8539e26a7406 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bchretien/bloom | 51b12507745521989944730f1c6b8539e26a7406 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
from setuptools import setup, find_packages
install_requires = [
'catkin-pkg >= 0.1.14',
'distribute',
'empy',
'python-dateutil',
'PyYAML',
'rosdep >= 0.10.25',
'rosdistro >= 0.3.0',
'vcstools >= 0.1.22',
]
# argparse got moved into the stdlib in py2.7... | 38.371795 | 82 | 0.655864 |
import sys
from setuptools import setup, find_packages
install_requires = [
'catkin-pkg >= 0.1.14',
'distribute',
'empy',
'python-dateutil',
'PyYAML',
'rosdep >= 0.10.25',
'rosdistro >= 0.3.0',
'vcstools >= 0.1.22',
]
# python.
if sys.version_info[0] == 2 and sys.version_info[1] <=... | true | true |
1c32a4844f9e79a9d27d43aaaf31661fe5746e0a | 19,655 | py | Python | discord/scheduled_event.py | bokja/discord.py-master | 7b4bd2eafebeb1b3c186f95cd71b1baaad5b43dd | [
"MIT"
] | null | null | null | discord/scheduled_event.py | bokja/discord.py-master | 7b4bd2eafebeb1b3c186f95cd71b1baaad5b43dd | [
"MIT"
] | null | null | null | discord/scheduled_event.py | bokja/discord.py-master | 7b4bd2eafebeb1b3c186f95cd71b1baaad5b43dd | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merg... | 34.482456 | 155 | 0.614551 |
from __future__ import annotations
from datetime import datetime
from typing import TYPE_CHECKING, AsyncIterator, Dict, Optional, Union
from .asset import Asset
from .enums import EventStatus, EntityType, PrivacyLevel, try_enum
from .mixins import Hashable
from .object import Object, OLDEST_OBJECT
from .utils import... | true | true |
1c32a485711f2f6dcfcfe2f285a60d4af9815af0 | 295 | py | Python | app/rss_feeder_api/tasks.py | RSaab/rss-scraper | 9bf608878e7d08fea6508ae90b27f1c226b313f1 | [
"MIT"
] | null | null | null | app/rss_feeder_api/tasks.py | RSaab/rss-scraper | 9bf608878e7d08fea6508ae90b27f1c226b313f1 | [
"MIT"
] | null | null | null | app/rss_feeder_api/tasks.py | RSaab/rss-scraper | 9bf608878e7d08fea6508ae90b27f1c226b313f1 | [
"MIT"
] | null | null | null | from rss_feeder_api.celery import app
from rss_feeder_api.models import Feed
@app.task
def my_scheduled_job():
print("cron job")
updateAllFeeds()
def updateAllFeeds():
feeds = Feed.objects.filter(flagged=False)
for feed in feeds:
feed.force_update()
print("Done!") | 21.071429 | 46 | 0.708475 | from rss_feeder_api.celery import app
from rss_feeder_api.models import Feed
@app.task
def my_scheduled_job():
print("cron job")
updateAllFeeds()
def updateAllFeeds():
feeds = Feed.objects.filter(flagged=False)
for feed in feeds:
feed.force_update()
print("Done!") | true | true |
1c32a4a16b01d9fe059907ca4bf7bb7373fd1a9c | 1,592 | py | Python | chevah/txftps/checkers.py | chevah/txftps | 2227c0017299c840e7e9b69022bac4bb2dd38ae4 | [
"BSD-3-Clause"
] | 4 | 2017-04-14T11:22:37.000Z | 2021-06-09T10:53:37.000Z | chevah/txftps/checkers.py | chevah/txftps | 2227c0017299c840e7e9b69022bac4bb2dd38ae4 | [
"BSD-3-Clause"
] | 1 | 2021-10-13T14:17:18.000Z | 2021-10-13T14:17:18.000Z | chevah/txftps/checkers.py | chevah/txftps | 2227c0017299c840e7e9b69022bac4bb2dd38ae4 | [
"BSD-3-Clause"
] | 1 | 2015-06-11T14:07:15.000Z | 2015-06-11T14:07:15.000Z | from zope.interface import implements
from twisted.cred.checkers import ICredentialsChecker
from twisted.internet import defer, error
from chevah.txftps.interfaces import (
IPasswordCredentials,
ISSLCertificateCredentials,
)
class InMemoryPassword(object):
implements(ICredentialsChecker)
credenti... | 28.945455 | 57 | 0.67902 | from zope.interface import implements
from twisted.cred.checkers import ICredentialsChecker
from twisted.internet import defer, error
from chevah.txftps.interfaces import (
IPasswordCredentials,
ISSLCertificateCredentials,
)
class InMemoryPassword(object):
implements(ICredentialsChecker)
credenti... | true | true |
1c32a557a767c625830d86fa0aa28718e3690cba | 748 | py | Python | basiclearning/filter_map_reduce_zip.py | GSGSS/git_learning | ceeabfe88edf2ecbfaf58eb42ca878a7a0910c4c | [
"MIT"
] | null | null | null | basiclearning/filter_map_reduce_zip.py | GSGSS/git_learning | ceeabfe88edf2ecbfaf58eb42ca878a7a0910c4c | [
"MIT"
] | null | null | null | basiclearning/filter_map_reduce_zip.py | GSGSS/git_learning | ceeabfe88edf2ecbfaf58eb42ca878a7a0910c4c | [
"MIT"
] | null | null | null | from functools import reduce
# filter 满足条件返回
a = [1, 2, 3, 4, 5, 6, 7, 8, 9]
b = 5
slict = filter(lambda x: x < b, a)
print(type(slict))
print(list(slict))
# map 依次操作每一个参数
a = [1, 2, 3]
map1 = map(lambda x: x+1, a)
print(type(map1))
print(list(map1))
b = [4, 5, 6]
map2 = map(lambda x, y: x+y, a, b)
print(type(map2))
... | 19.684211 | 48 | 0.627005 | from functools import reduce
a = [1, 2, 3, 4, 5, 6, 7, 8, 9]
b = 5
slict = filter(lambda x: x < b, a)
print(type(slict))
print(list(slict))
a = [1, 2, 3]
map1 = map(lambda x: x+1, a)
print(type(map1))
print(list(map1))
b = [4, 5, 6]
map2 = map(lambda x, y: x+y, a, b)
print(type(map2))
print(list(map2))
reduce1 = ... | true | true |
1c32a6265cea90b2736089890ec05093424577c9 | 2,944 | py | Python | homework04/tests/test_tree.py | kristinazagaynova/programming-kristinazagaynova | d154a27f927d6da0135bffbd75330d4da8039f98 | [
"Unlicense"
] | null | null | null | homework04/tests/test_tree.py | kristinazagaynova/programming-kristinazagaynova | d154a27f927d6da0135bffbd75330d4da8039f98 | [
"Unlicense"
] | null | null | null | homework04/tests/test_tree.py | kristinazagaynova/programming-kristinazagaynova | d154a27f927d6da0135bffbd75330d4da8039f98 | [
"Unlicense"
] | 1 | 2021-02-20T09:36:40.000Z | 2021-02-20T09:36:40.000Z | import pathlib
import stat
import time
import unittest
from unittest.mock import patch
from pyfakefs.fake_filesystem_unittest import TestCase
import pyvcs
from pyvcs.index import read_index, update_index
from pyvcs.repo import repo_create
from pyvcs.tree import commit_tree, write_tree
@unittest.skipIf(pyvcs.__versi... | 41.464789 | 97 | 0.699728 | import pathlib
import stat
import time
import unittest
from unittest.mock import patch
from pyfakefs.fake_filesystem_unittest import TestCase
import pyvcs
from pyvcs.index import read_index, update_index
from pyvcs.repo import repo_create
from pyvcs.tree import commit_tree, write_tree
@unittest.skipIf(pyvcs.__versi... | true | true |
1c32a6ea55192b9a0ff8c4aabefaed68e451b27c | 4,128 | py | Python | label_maker_dask/utils.py | developmentseed/label-maker-dask | 700d2fa224ac674171fd8c4f8709a67f862eac36 | [
"MIT"
] | 5 | 2021-10-09T03:25:46.000Z | 2021-10-20T07:17:15.000Z | label_maker_dask/utils.py | developmentseed/label-maker-dask | 700d2fa224ac674171fd8c4f8709a67f862eac36 | [
"MIT"
] | 1 | 2021-10-15T12:39:16.000Z | 2021-10-15T13:51:01.000Z | label_maker_dask/utils.py | developmentseed/label-maker-dask | 700d2fa224ac674171fd8c4f8709a67f862eac36 | [
"MIT"
] | null | null | null | # pylint: disable=unused-argument
"""Provide utility functions"""
import os
from io import BytesIO
from urllib.parse import parse_qs
import numpy as np
import rasterio
import requests # type: ignore
from mercantile import Tile, bounds
from PIL import Image, ImageColor
from rasterio.crs import CRS
from rasterio.warp i... | 29.697842 | 88 | 0.662306 |
import os
from io import BytesIO
from urllib.parse import parse_qs
import numpy as np
import rasterio
import requests
from mercantile import Tile, bounds
from PIL import Image, ImageColor
from rasterio.crs import CRS
from rasterio.warp import transform_bounds
from rio_tiler.io import COGReader
WGS84_CRS = CRS.from... | true | true |
1c32a743ab53fee05dd8f26beea9f33a973416ba | 2,751 | py | Python | zimsoap/utils.py | emillion/zimsoap | d1ea2eb4d50f263c9a16e5549af03f1eff3e295e | [
"Apache-2.0"
] | 11 | 2015-02-15T23:52:56.000Z | 2021-05-06T18:05:24.000Z | zimsoap/utils.py | emillion/zimsoap | d1ea2eb4d50f263c9a16e5549af03f1eff3e295e | [
"Apache-2.0"
] | 25 | 2015-01-14T11:27:51.000Z | 2016-09-07T14:06:52.000Z | zimsoap/utils.py | emillion/zimsoap | d1ea2eb4d50f263c9a16e5549af03f1eff3e295e | [
"Apache-2.0"
] | 10 | 2015-08-12T14:45:17.000Z | 2021-12-08T23:40:35.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
""" Misc tool functions """
import pythonzimbra
import pythonzimbra.tools.xmlserializer
import re
import hmac
import hashlib
from xml.dom import minidom
re_zuuid = re.compile(r'[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}')
def is_... | 24.345133 | 77 | 0.605598 |
from __future__ import unicode_literals
import pythonzimbra
import pythonzimbra.tools.xmlserializer
import re
import hmac
import hashlib
from xml.dom import minidom
re_zuuid = re.compile(r'[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}')
def is_zuuid(s):
return re_zuuid.match(s)
def build_preauth_str(preauth_k... | true | true |
1c32a762ed63dbf544b7ab083136c6ed1003bf50 | 7,866 | py | Python | strelka_card.py | apetrin/FeriatBot | e9df759789dc584c0e35ff10a1422179448248a6 | [
"MIT"
] | 2 | 2016-08-09T21:29:41.000Z | 2017-03-22T12:34:08.000Z | strelka_card.py | feriat/FeriatBot | e9df759789dc584c0e35ff10a1422179448248a6 | [
"MIT"
] | null | null | null | strelka_card.py | feriat/FeriatBot | e9df759789dc584c0e35ff10a1422179448248a6 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import telegram
from telegram import Bot
from telegram.ext import Updater, CommandHandler, RegexHandler
import logging
import os.path
from os import chdir
import cPickle as pickle
from strelka_user import StrelkaUser
from credentials import ADMIN_ID, TELEGRAM_TO... | 38.940594 | 122 | 0.57882 |
import telegram
from telegram import Bot
from telegram.ext import Updater, CommandHandler, RegexHandler
import logging
import os.path
from os import chdir
import cPickle as pickle
from strelka_user import StrelkaUser
from credentials import ADMIN_ID, TELEGRAM_TOKEN
class StrelkaBot(object):
def ... | false | true |
1c32a89be30839ceba73043fa19ebfc6b0ba0ee2 | 35,814 | py | Python | Wrapping/Python/paraview/smtrace.py | UV-CDAT/ParaView | 095ac28404a85fd86676491b8952884805842223 | [
"Apache-2.0"
] | null | null | null | Wrapping/Python/paraview/smtrace.py | UV-CDAT/ParaView | 095ac28404a85fd86676491b8952884805842223 | [
"Apache-2.0"
] | null | null | null | Wrapping/Python/paraview/smtrace.py | UV-CDAT/ParaView | 095ac28404a85fd86676491b8952884805842223 | [
"Apache-2.0"
] | null | null | null |
import simple
import servermanager
import re
class trace_globals: pass
def reset_trace_observer():
trace_globals.observer = servermanager.vtkSMPythonTraceObserver()
trace_globals.observer_active = False
def reset_trace_globals():
trace_globals.capture_all_properties = False
trace_globals.capture_modified_p... | 42.084606 | 108 | 0.723516 |
import simple
import servermanager
import re
class trace_globals: pass
def reset_trace_observer():
trace_globals.observer = servermanager.vtkSMPythonTraceObserver()
trace_globals.observer_active = False
def reset_trace_globals():
trace_globals.capture_all_properties = False
trace_globals.capture_modified_p... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.