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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4ac43fe52487a7f0bd887554dc6cd88c8beb6f | 3,233 | py | Python | maml_examples/cluster_maml_trpo_ant.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | maml_examples/cluster_maml_trpo_ant.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | maml_examples/cluster_maml_trpo_ant.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | from sandbox.rocky.tf.algos.maml_trpo import MAMLTRPO
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.baselines.gaussian_mlp_baseline import GaussianMLPBaseline
from rllab.envs.mujoco.ant_env_rand import AntEnvRand
from rllab.envs.mujoco.ant_env_rand_goal import AntEnvRandGoal
from ... | 29.66055 | 174 | 0.666564 | from sandbox.rocky.tf.algos.maml_trpo import MAMLTRPO
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.baselines.gaussian_mlp_baseline import GaussianMLPBaseline
from rllab.envs.mujoco.ant_env_rand import AntEnvRand
from rllab.envs.mujoco.ant_env_rand_goal import AntEnvRandGoal
from ... | true | true |
1c4ac4962fab48761d3549b1ff774f9ba8c83d10 | 3,182 | py | Python | v2/cleanup/clean_relatedness_data.py | amoudgl/pun-model | bf18335a58ecfb8624d5b40b619a2bf7bbb72714 | [
"BSD-3-Clause"
] | 13 | 2019-04-18T10:09:16.000Z | 2022-03-01T21:42:51.000Z | v2/cleanup/clean_relatedness_data.py | amoudgl/pun-model | bf18335a58ecfb8624d5b40b619a2bf7bbb72714 | [
"BSD-3-Clause"
] | 1 | 2022-03-01T22:24:14.000Z | 2022-03-01T22:24:14.000Z | v2/cleanup/clean_relatedness_data.py | amoudgl/pun-model | bf18335a58ecfb8624d5b40b619a2bf7bbb72714 | [
"BSD-3-Clause"
] | 3 | 2019-04-16T03:21:50.000Z | 2021-06-04T05:34:08.000Z | #!/usr/bin/env python3
from utils import data2numpy, map_puntypeID_to_idx
relatedness_near_datapath = ("./wordPair_relatedness_" +
"smoothedTrigrams_near.csv")
relatedness_identical_datapath = ("./wordPair_relatedness_" +
"smoothedTrigrams_identical.csv")
... | 31.196078 | 79 | 0.650849 | from utils import data2numpy, map_puntypeID_to_idx
relatedness_near_datapath = ("./wordPair_relatedness_" +
"smoothedTrigrams_near.csv")
relatedness_identical_datapath = ("./wordPair_relatedness_" +
"smoothedTrigrams_identical.csv")
meanings = {}
puns_dat... | true | true |
1c4ac5f669e93e7f785530f47d72998b4960e2bd | 745 | py | Python | mvc/router.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | mvc/router.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | mvc/router.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | from werkzeug.routing import Map, Rule
class Router:
_registry = {}
_controllers = {}
@staticmethod
def get(pattern, callback):
Router._register('GET', pattern, callback)
@staticmethod
def post(pattern, callback):
Router._register('POST', pattern, callback)
@staticmethod... | 25.689655 | 89 | 0.601342 | from werkzeug.routing import Map, Rule
class Router:
_registry = {}
_controllers = {}
@staticmethod
def get(pattern, callback):
Router._register('GET', pattern, callback)
@staticmethod
def post(pattern, callback):
Router._register('POST', pattern, callback)
@staticmethod... | true | true |
1c4ac5f9721e8cfa983599bd81afe585bdecdf5f | 2,530 | py | Python | config/settings/local.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | config/settings/local.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | config/settings/local.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
'''
import environ
from .mysqlconf import *
from .common import * # noqa
# mezzanine app settings
from .mezzaconf import *
# DEBUG
# --------------------------... | 29.418605 | 99 | 0.549407 | import environ
from .mysqlconf import *
from .common import *
from .mezzaconf import *
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
SECRET_KEY = env("DJANGO_SECRET_KEY", default='dwqfjwf&q-8+#ko-#8k)jpf#h8bp(@515@x@l#=w3ktswereue')
EMAIL_HOST = 'localhost'
EMAIL_PORT =... | true | true |
1c4ac6ac9b7ea1e11c442e577ca5452024f8d69a | 4,309 | py | Python | main.py | jakestrouse00/Python-Art | f5ddea614789ef8e13881f888f80b94d6aae5f9e | [
"MIT"
] | 1 | 2020-03-05T08:54:29.000Z | 2020-03-05T08:54:29.000Z | main.py | jakestrouse00/Python-Art | f5ddea614789ef8e13881f888f80b94d6aae5f9e | [
"MIT"
] | null | null | null | main.py | jakestrouse00/Python-Art | f5ddea614789ef8e13881f888f80b94d6aae5f9e | [
"MIT"
] | null | null | null | from turtle import *
import random
import threading
from tkinter import *
# generate random seed
num = random.randint(1897348294, 18495729473285739)
print("\n\nUsing Seed: " + str(num))
# set the seed for all randomization
random.seed(num)
# save the current seed to a text file
with open('current_seed.txt', 'w') as f:... | 26.115152 | 80 | 0.635182 | from turtle import *
import random
import threading
from tkinter import *
num = random.randint(1897348294, 18495729473285739)
print("\n\nUsing Seed: " + str(num))
random.seed(num)
with open('current_seed.txt', 'w') as f:
f.write(str(num))
colors = ['blue', 'red', 'purple', 'yellow', 'green', 'orange', 'hot_colors... | true | true |
1c4ac7c71bb9d7a5423ddf8200fe2fede8b354f7 | 87 | py | Python | python/testData/docstrings/googleDescriptionOfReturnValueOnNextLine.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/docstrings/googleDescriptionOfReturnValueOnNextLine.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/docstrings/googleDescriptionOfReturnValueOnNextLine.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def func():
"""
Returns:
int:
return value description
""" | 14.5 | 33 | 0.448276 | def func(): | true | true |
1c4ac865607d0326e4cf6dc830274b68eb3d48d7 | 28 | py | Python | pyrcc/__init__.py | vishalbelsare/pyrcc | 3dfb9721a41f5c253690fd42a4540f639534ce9b | [
"MIT"
] | 96 | 2017-09-16T16:00:51.000Z | 2021-12-07T07:53:57.000Z | pyrcc/__init__.py | jtpils/pyrcc | 3dfb9721a41f5c253690fd42a4540f639534ce9b | [
"MIT"
] | 1 | 2021-04-21T16:49:23.000Z | 2021-04-21T16:49:23.000Z | pyrcc/__init__.py | jtpils/pyrcc | 3dfb9721a41f5c253690fd42a4540f639534ce9b | [
"MIT"
] | 30 | 2017-09-18T01:18:13.000Z | 2020-05-05T05:43:54.000Z | from .rcc import RccCluster
| 14 | 27 | 0.821429 | from .rcc import RccCluster
| true | true |
1c4ac916ab8d1749743c2e814fb947997a9a280c | 4,709 | py | Python | utils.py | NateEaton/igrill | 30caa7af3d6861ecfcb004fb34dfc7c316ff7b74 | [
"MIT"
] | null | null | null | utils.py | NateEaton/igrill | 30caa7af3d6861ecfcb004fb34dfc7c316ff7b74 | [
"MIT"
] | null | null | null | utils.py | NateEaton/igrill | 30caa7af3d6861ecfcb004fb34dfc7c316ff7b74 | [
"MIT"
] | null | null | null | from builtins import range
from config import strip_config
from igrill import IGrillMiniPeripheral, IGrillV2Peripheral, IGrillV3Peripheral, Pulse2000Peripheral, DeviceThread
import logging
import paho.mqtt.client as mqtt
config_requirements = {
'specs': {
'required_entries': {'devices': list, 'mqtt': dict}... | 35.141791 | 114 | 0.551922 | from builtins import range
from config import strip_config
from igrill import IGrillMiniPeripheral, IGrillV2Peripheral, IGrillV3Peripheral, Pulse2000Peripheral, DeviceThread
import logging
import paho.mqtt.client as mqtt
config_requirements = {
'specs': {
'required_entries': {'devices': list, 'mqtt': dict}... | true | true |
1c4ac9638d00c55a6fc59df6fd2a50f24ece27ef | 563 | py | Python | pythonExercicios/ex115/sistema.py | Yhago-Carvalho/CursoPython | 343ccabb1a61e16c6078de9672c78c56deed2589 | [
"MIT"
] | null | null | null | pythonExercicios/ex115/sistema.py | Yhago-Carvalho/CursoPython | 343ccabb1a61e16c6078de9672c78c56deed2589 | [
"MIT"
] | null | null | null | pythonExercicios/ex115/sistema.py | Yhago-Carvalho/CursoPython | 343ccabb1a61e16c6078de9672c78c56deed2589 | [
"MIT"
] | null | null | null | from lib.arquivo import *
from lib.interface import *
if not arquivo_existe('cursoemvideo.txt'):
criar_arquivo('cursoemvideo.txt')
while True:
o = menu('Sua opção: ')
if o == 1:
#Mostra as pessoas cadastradas
ler_arquivo('cursoemvideo.txt')
elif o == 2:
#Cadastra uma pessoa
... | 26.809524 | 50 | 0.598579 | from lib.arquivo import *
from lib.interface import *
if not arquivo_existe('cursoemvideo.txt'):
criar_arquivo('cursoemvideo.txt')
while True:
o = menu('Sua opção: ')
if o == 1:
ler_arquivo('cursoemvideo.txt')
elif o == 2:
titulo('NOVO CADASTRO')
nome = input('N... | true | true |
1c4ac9be98e27c1ea3752c2bd2d934194b92a207 | 1,492 | py | Python | tweepy-bots/followerextract.py | kassuahun/Twitterprj | 23c7272201a0a62f2aaa9d1081a5f1d74b66b144 | [
"Apache-2.0"
] | null | null | null | tweepy-bots/followerextract.py | kassuahun/Twitterprj | 23c7272201a0a62f2aaa9d1081a5f1d74b66b144 | [
"Apache-2.0"
] | null | null | null | tweepy-bots/followerextract.py | kassuahun/Twitterprj | 23c7272201a0a62f2aaa9d1081a5f1d74b66b144 | [
"Apache-2.0"
] | null | null | null | import tweepy
import time
import sys
from datetime import datetime
from config import create_api, create_api_List, create_api_test
from limits import limits
import random
import os
import utils
import logging
import atexit
api = create_api()
# the ID of the user
id = 1168167671151628290
# fetching the user
user... | 26.642857 | 88 | 0.654155 | import tweepy
import time
import sys
from datetime import datetime
from config import create_api, create_api_List, create_api_test
from limits import limits
import random
import os
import utils
import logging
import atexit
api = create_api()
id = 1168167671151628290
user = api.get_user(id)
print("USER NAME = "... | true | true |
1c4aca9d8963bb2cd9e31b728c9373a6ac656cdd | 16,441 | py | Python | dovetail/utils/dovetail_utils.py | xudan16/dovetail | 6230a0d2c47c32d970f3197021efee8f9669282b | [
"Apache-2.0"
] | 3 | 2018-11-14T14:42:45.000Z | 2018-12-20T21:56:48.000Z | dovetail/utils/dovetail_utils.py | xudan16/dovetail | 6230a0d2c47c32d970f3197021efee8f9669282b | [
"Apache-2.0"
] | 4 | 2021-03-25T21:57:27.000Z | 2021-09-23T23:21:52.000Z | dovetail/utils/dovetail_utils.py | xudan16/dovetail | 6230a0d2c47c32d970f3197021efee8f9669282b | [
"Apache-2.0"
] | 20 | 2016-11-11T06:38:14.000Z | 2020-10-25T16:48:12.000Z | #!/usr/bin/env python
#
# Copyright (c) 2018 grakiss.wanglei@huawei.com and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LIC... | 35.819172 | 78 | 0.599051 |
from __future__ import print_function
import sys
import os
import re
import requests
import subprocess
from collections import Mapping, Set, Sequence
import json
from datetime import datetime
from distutils.version import LooseVersion
import yaml
import python_hosts
import docker
from docker.types import Mount
from d... | true | true |
1c4acc2f700ed5667eb91162f430658b3774cfda | 4,744 | py | Python | webassign_grades_to_brightspace/webassign_grades_to_brightspace.py | christopherphan/brightspace-scripts | 6cfc588a9f0f3208f73fd5a893d0197d3dfeab50 | [
"MIT"
] | 1 | 2020-09-17T19:48:10.000Z | 2020-09-17T19:48:10.000Z | webassign_grades_to_brightspace/webassign_grades_to_brightspace.py | christopherphan/brightspace-scripts | 6cfc588a9f0f3208f73fd5a893d0197d3dfeab50 | [
"MIT"
] | null | null | null | webassign_grades_to_brightspace/webassign_grades_to_brightspace.py | christopherphan/brightspace-scripts | 6cfc588a9f0f3208f73fd5a893d0197d3dfeab50 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# webassign_grades_to_brightspace.py
#
# Christopher L. Phan, Ph.D.
# cphan@chrisphan.com
# Last updated: 2019-05-23
#
#################################
# Copyright (c) 2019 Christopher L. Phan
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software a... | 37.0625 | 103 | 0.634907 |
help_string = """
webassign_grades_to_brightspace.py
Copyright (c) 2019 Christopher L. Phan
See README.md or source code for important license and disclaimer of warranty
notice.
Converts a WebAssign grade export file to a format that can be imported under D2L Brightspace.
For this script to work, you need 2 f... | true | true |
1c4acc4771c6410e1e1685fee0d975f4b24e233e | 370 | py | Python | output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.atomic.any_uri.schema_instance.nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd.nistschema_sv_iv_atomic_any_uri_enumeration_5 import (
NistschemaSvIvAtomicAnyUriEnumeration5,
NistschemaSvIvAtomicAnyUriEnumeration5Type,
)
__all__ = [
"NistschemaSvIvAtomicAnyUriEnumeration5",
... | 37 | 164 | 0.864865 | from output.models.nist_data.atomic.any_uri.schema_instance.nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd.nistschema_sv_iv_atomic_any_uri_enumeration_5 import (
NistschemaSvIvAtomicAnyUriEnumeration5,
NistschemaSvIvAtomicAnyUriEnumeration5Type,
)
__all__ = [
"NistschemaSvIvAtomicAnyUriEnumeration5",
... | true | true |
1c4acc8d126515aa4dd30b64e9be465fd5ab13b8 | 2,237 | py | Python | examples/github/features/test_github_search.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | examples/github/features/test_github_search.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | examples/github/features/test_github_search.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | """
An example of a test module that follows the typical pytest test
structure. These tests show off how to use custom tasks and questions,
though they are a little bit contrived.
"""
from typing import Generator
import pytest
from screenpy import Actor, AnActor, given, then, when
from screenpy.abilities import Brow... | 34.953125 | 75 | 0.753688 |
from typing import Generator
import pytest
from screenpy import Actor, AnActor, given, then, when
from screenpy.abilities import BrowseTheWeb
from screenpy.actions import Open
from screenpy.pacing import act, scene
from screenpy.resolutions import (
ContainsTheText,
ContainTheText,
DoesNot,
IsEqualTo... | true | true |
1c4ace0ee97cb02a09668b10170665e6f09dee51 | 618 | py | Python | examples/animations/recursive_composite.py | goodhertz/coldtype | 2460b66abb28e9532f9e2b55167ae565f95366e7 | [
"Apache-2.0"
] | 142 | 2020-06-12T17:01:58.000Z | 2022-03-16T23:21:37.000Z | examples/animations/recursive_composite.py | goodhertz/coldtype | 2460b66abb28e9532f9e2b55167ae565f95366e7 | [
"Apache-2.0"
] | 35 | 2020-04-15T15:34:54.000Z | 2022-03-19T20:26:47.000Z | examples/animations/recursive_composite.py | goodhertz/coldtype | 2460b66abb28e9532f9e2b55167ae565f95366e7 | [
"Apache-2.0"
] | 14 | 2020-06-23T18:56:46.000Z | 2022-03-31T15:54:56.000Z | from coldtype import *
from coldtype.fx.skia import fill, phototype
@animation((1080, 1080), timeline=90, composites=1)
def recursive_composite(f):
return (DPS([
f.last_render(lambda p: p
.translate(1, -2)
.scale(0.997)
.ch(fill(1))),
(DP(Rect(200, 200))
... | 34.333333 | 60 | 0.511327 | from coldtype import *
from coldtype.fx.skia import fill, phototype
@animation((1080, 1080), timeline=90, composites=1)
def recursive_composite(f):
return (DPS([
f.last_render(lambda p: p
.translate(1, -2)
.scale(0.997)
.ch(fill(1))),
(DP(Rect(200, 200))
... | true | true |
1c4aceb4e5772df987ce568ec6025ed09d9c93df | 134 | py | Python | src/softfab/docs/reference/__init__.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | 20 | 2019-02-07T17:03:04.000Z | 2020-03-16T20:45:19.000Z | src/softfab/docs/reference/__init__.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | 36 | 2019-02-11T08:57:16.000Z | 2020-09-29T05:32:08.000Z | src/softfab/docs/reference/__init__.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
button = 'Reference'
children = ('api', 'cmdline', 'releases', 'wrappers')
icon = 'IconDocs'
| 22.333333 | 53 | 0.686567 |
button = 'Reference'
children = ('api', 'cmdline', 'releases', 'wrappers')
icon = 'IconDocs'
| true | true |
1c4acfe937c7a3c496387cf35b341673a39ff740 | 2,239 | py | Python | compressible_sr/problems/rt.py | zooechiu/pyro2 | 51874476e9c3c3c412c66850ab819ca70af0b20c | [
"BSD-3-Clause"
] | 151 | 2018-08-14T12:52:22.000Z | 2022-03-29T07:57:01.000Z | compressible_sr/problems/rt.py | gfjykldd/pyro2 | b0ca4aa7b1b0f0d445c6a8d0ab63fcc0bc8a431c | [
"BSD-3-Clause"
] | 40 | 2015-03-25T15:45:44.000Z | 2018-07-30T18:48:47.000Z | compressible_sr/problems/rt.py | gfjykldd/pyro2 | b0ca4aa7b1b0f0d445c6a8d0ab63fcc0bc8a431c | [
"BSD-3-Clause"
] | 56 | 2018-10-10T16:54:59.000Z | 2022-02-06T08:48:52.000Z | from __future__ import print_function
import numpy as np
import sys
import mesh.patch as patch
import compressible_sr.eos as eos
from util import msg
def init_data(my_data, rp):
""" initialize the rt problem """
msg.bold("initializing the rt problem...")
# make sure that we are passed a valid patch ob... | 26.341176 | 105 | 0.564538 | from __future__ import print_function
import numpy as np
import sys
import mesh.patch as patch
import compressible_sr.eos as eos
from util import msg
def init_data(my_data, rp):
msg.bold("initializing the rt problem...")
if not isinstance(my_data, patch.CellCenterData2d):
print("ERROR: patch i... | true | true |
1c4ad12ed636214868ae564499c2f27c7c5eb010 | 4,523 | py | Python | devresources/settings.py | Sachin-chaurasiya/devresources | a1aaee1d62b755483ff533bb07ed344a1a155a1f | [
"MIT"
] | null | null | null | devresources/settings.py | Sachin-chaurasiya/devresources | a1aaee1d62b755483ff533bb07ed344a1a155a1f | [
"MIT"
] | null | null | null | devresources/settings.py | Sachin-chaurasiya/devresources | a1aaee1d62b755483ff533bb07ed344a1a155a1f | [
"MIT"
] | null | null | null | """
Django settings for devresources project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import o... | 25.994253 | 91 | 0.683617 | import os
import dotenv
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
dotenv_file = os.path.join(BASE_DIR, ".env")
if os.path.isfile(dotenv_file):
dotenv.load_dotenv(dotenv_file)
SECRET_KEY = os.environ["SECRET_KEY"]
DEBUG = os.environ.get("DEBUG", False)
ALLOWED_HOSTS = ["localh... | true | true |
1c4ad283daf0722e256ef228e2048c6cc80b222e | 1,485 | py | Python | new_package/seed/rename_sync_file.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | new_package/seed/rename_sync_file.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | new_package/seed/rename_sync_file.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | """
rename generated sync asdf file based on the cmt solution files. (relocation)
"""
import subprocess
import click
import obspy
from os.path import join
from glob import glob
def rename_single(mapper, filepath):
# filename = filepath.split("/")[-1]
# filename_new = mapper[filename]
# filepath_new = join... | 30.306122 | 86 | 0.657239 | import subprocess
import click
import obspy
from os.path import join
from glob import glob
def rename_single(mapper, filepath):
filename = filepath.split("/")[-1]
key = filename.split(".")[0].split("_")[1]
key_new = mapper[key]
all_split = filename.split(".")[0].split("_")
all_split[1]... | true | true |
1c4ad3f0fe7fc064e5ce1cba97d6cff0cee2f20b | 10,251 | py | Python | handlers/song.py | Bluehatcoders/Telegram_Vc_Bot | ba9605084275d0a6ec266407e54df5a4cacc5e86 | [
"Apache-2.0"
] | null | null | null | handlers/song.py | Bluehatcoders/Telegram_Vc_Bot | ba9605084275d0a6ec266407e54df5a4cacc5e86 | [
"Apache-2.0"
] | null | null | null | handlers/song.py | Bluehatcoders/Telegram_Vc_Bot | ba9605084275d0a6ec266407e54df5a4cacc5e86 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import os
import requests
import aiohttp
import youtube_dl
import wget
import math
from pyrogram import filters, Client
from youtube_search import YoutubeSearch
from urllib.parse import urlparse
import aiofiles
import os
from random import randint
from youtubesearchpython import ... | 32.961415 | 342 | 0.586674 | from __future__ import unicode_literals
import os
import requests
import aiohttp
import youtube_dl
import wget
import math
from pyrogram import filters, Client
from youtube_search import YoutubeSearch
from urllib.parse import urlparse
import aiofiles
import os
from random import randint
from youtubesearchpython import ... | true | true |
1c4ad4ad9b8231fd18565220e4311acfb7bcd546 | 2,634 | py | Python | visualisations/linear_regression.py | SaadChaouki/ml-eli5-cli5 | 625a69edadf4737e41c58193873cf8a54273d7f0 | [
"MIT"
] | 1 | 2021-05-04T19:53:12.000Z | 2021-05-04T19:53:12.000Z | visualisations/linear_regression.py | SaadChaouki/ml-eli5-cli5 | 625a69edadf4737e41c58193873cf8a54273d7f0 | [
"MIT"
] | null | null | null | visualisations/linear_regression.py | SaadChaouki/ml-eli5-cli5 | 625a69edadf4737e41c58193873cf8a54273d7f0 | [
"MIT"
] | null | null | null | from supervised.regression.linearRegression import LinearRegression
from visualisations.color_palette import two_colors
from deep_learning.loss import MSELoss
from sklearn.model_selection import train_test_split
from sklearn.datasets import make_regression
from matplotlib.animation import FuncAnimation
import matplot... | 36.583333 | 107 | 0.714503 | from supervised.regression.linearRegression import LinearRegression
from visualisations.color_palette import two_colors
from deep_learning.loss import MSELoss
from sklearn.model_selection import train_test_split
from sklearn.datasets import make_regression
from matplotlib.animation import FuncAnimation
import matplot... | true | true |
1c4ad4b41b0454140375984125d9d65161765ca1 | 1,711 | py | Python | oeml-sdk/python/test/test_order_cancel_all_request.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | 1 | 2020-07-23T05:47:52.000Z | 2020-07-23T05:47:52.000Z | oeml-sdk/python/test/test_order_cancel_all_request.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | null | null | null | oeml-sdk/python/test/test_order_cancel_all_request.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
OEML - REST API
This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> # noqa: E501
The version... | 31.109091 | 261 | 0.687902 |
from __future__ import absolute_import
import unittest
import datetime
import openapi_client
from openapi_client.models.order_cancel_all_request import OrderCancelAllRequest from openapi_client.rest import ApiException
class TestOrderCancelAllRequest(unittest.TestCase):
def setUp(self):
pass
de... | true | true |
1c4ad4df6ff6671740e265a9a52975b025f45096 | 7,383 | py | Python | userbot/__init__.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-04-09T01:11:33.000Z | 2020-04-09T01:11:33.000Z | userbot/__init__.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/__init__.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot initialization. """
import os
from sys import version_info
from logging import basicConfig, getLogger, IN... | 32.240175 | 143 | 0.720439 |
import os
from sys import version_info
from logging import basicConfig, getLogger, INFO, DEBUG
from distutils.util import strtobool as sb
from pylast import LastFMNetwork, md5
from pySmartDL import SmartDL
from dotenv import load_dotenv
from requests import get
from telethon import TelegramClient
from telethon.sessi... | true | true |
1c4ad6f2ead8fd5590dda5ddff82e834af7eaa24 | 1,825 | py | Python | decrypt.py | tjmovie/psse-decrypt | f2c8f09738185766f8b04253f79f627ae433de7a | [
"Unlicense"
] | null | null | null | decrypt.py | tjmovie/psse-decrypt | f2c8f09738185766f8b04253f79f627ae433de7a | [
"Unlicense"
] | null | null | null | decrypt.py | tjmovie/psse-decrypt | f2c8f09738185766f8b04253f79f627ae433de7a | [
"Unlicense"
] | null | null | null | import os
import binascii
import sys
from Crypto.Cipher import AES
game_key = b""
def ReadGameKey(filename):
global game_key
riffd = open(filename, "rb")
riffd.seek(0x120)
game_key = riffd.read(0x10)
riffd.close()
def DecryptFile(filename):
fd = open(filename, "rb")
header =... | 29.435484 | 85 | 0.610411 | import os
import binascii
import sys
from Crypto.Cipher import AES
game_key = b""
def ReadGameKey(filename):
global game_key
riffd = open(filename, "rb")
riffd.seek(0x120)
game_key = riffd.read(0x10)
riffd.close()
def DecryptFile(filename):
fd = open(filename, "rb")
header =... | true | true |
1c4ad74c2747e25780643d5004eefc4b2adda9e9 | 8,693 | py | Python | webservice/utils/analyze_buildLog.py | randytli/Paddle-bot | c4dc7044a82047f46d47733ad31c10eab0417b4b | [
"Apache-2.0"
] | 1 | 2020-05-27T05:21:40.000Z | 2020-05-27T05:21:40.000Z | webservice/utils/analyze_buildLog.py | randytli/Paddle-bot | c4dc7044a82047f46d47733ad31c10eab0417b4b | [
"Apache-2.0"
] | null | null | null | webservice/utils/analyze_buildLog.py | randytli/Paddle-bot | c4dc7044a82047f46d47733ad31c10eab0417b4b | [
"Apache-2.0"
] | null | null | null | #coding=utf-8
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from utils.readConfig import ReadConfig
from utils.auth_ipipe import Get_ipipe_auth
from utils.db import Database
from utils import bosclient
import os
import time
import datetime
import logging
from tornado.httpclient... | 43.683417 | 117 | 0.644081 | import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from utils.readConfig import ReadConfig
from utils.auth_ipipe import Get_ipipe_auth
from utils.db import Database
from utils import bosclient
import os
import time
import datetime
import logging
from tornado.httpclient import AsyncH... | true | true |
1c4ad7bb528c874b879b1da41e20cceb700b3a0a | 3,651 | py | Python | mmfewshot/detection/models/roi_heads/bbox_heads/meta_bbox_head.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 376 | 2021-11-23T13:29:57.000Z | 2022-03-30T07:22:14.000Z | mmfewshot/detection/models/roi_heads/bbox_heads/meta_bbox_head.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 51 | 2021-11-23T14:45:08.000Z | 2022-03-30T03:37:15.000Z | mmfewshot/detection/models/roi_heads/bbox_heads/meta_bbox_head.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 56 | 2021-11-23T14:02:27.000Z | 2022-03-31T09:01:50.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import copy
from typing import Dict, Optional
import torch
import torch.nn as nn
from mmcv.runner import force_fp32
from mmdet.models.builder import HEADS, build_loss
from mmdet.models.losses import accuracy
from mmdet.models.roi_heads import BBoxHead
from torch import T... | 38.431579 | 76 | 0.612435 | import copy
from typing import Dict, Optional
import torch
import torch.nn as nn
from mmcv.runner import force_fp32
from mmdet.models.builder import HEADS, build_loss
from mmdet.models.losses import accuracy
from mmdet.models.roi_heads import BBoxHead
from torch import Tensor
@HEADS.register_module()
class MetaBBoxH... | true | true |
1c4ada067ccaae4dfb745c521b71812b9ecd0997 | 81,491 | py | Python | imjoy_elfinder/elfinder.py | oeway/jupyter_elfinder | e89eb535b6bdc9024a1af57ecc67056ce9b5a94f | [
"MIT"
] | null | null | null | imjoy_elfinder/elfinder.py | oeway/jupyter_elfinder | e89eb535b6bdc9024a1af57ecc67056ce9b5a94f | [
"MIT"
] | null | null | null | imjoy_elfinder/elfinder.py | oeway/jupyter_elfinder | e89eb535b6bdc9024a1af57ecc67056ce9b5a94f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Connector for elFinder File Manager
# Original author Troex Nevelin <troex@fury.scancode.ru>
# Modified by Svintsov Dmitry (https://github.com/uralbash)
# Further adapted by ImJoy Team (https://github.com/imjoy-team)
# License: 3-clauses BSD license
"""Provide the connector for elFinder File ... | 33.898087 | 88 | 0.504473 |
import base64
import hashlib
import mimetypes
import os
import re
import shlex
import shutil
import subprocess
import time
import traceback
import uuid
from datetime import datetime
from types import ModuleType
from typing import Any, BinaryIO, Dict, Generator, List, Optional, Tuple, Union
from urllib.parse import quo... | true | true |
1c4adaf952402e4e01c0172f18132c0bfdaf4075 | 4,308 | py | Python | tethys_portal/urls.py | quyendong/tethys | 99bcb524d5b2021b88d5fa15b7ed6b8acb460997 | [
"BSD-2-Clause"
] | 1 | 2020-10-08T20:38:33.000Z | 2020-10-08T20:38:33.000Z | tethys_portal/urls.py | quyendong/tethys | 99bcb524d5b2021b88d5fa15b7ed6b8acb460997 | [
"BSD-2-Clause"
] | 1 | 2018-04-14T19:40:54.000Z | 2018-04-14T19:40:54.000Z | tethys_portal/urls.py | quyendong/tethys | 99bcb524d5b2021b88d5fa15b7ed6b8acb460997 | [
"BSD-2-Clause"
] | 1 | 2021-09-07T14:47:11.000Z | 2021-09-07T14:47:11.000Z | """
********************************************************************************
* Name: urls.py
* Author: Nathan Swain
* Created On: 2014
* Copyright: (c) Brigham Young University 2014
* License: BSD 2-Clause
********************************************************************************
"""
from django.conf.urls... | 48.954545 | 115 | 0.694754 | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.views import password_reset, password_reset_done, password_reset_confirm, \
password_reset_complete
from django.conf import settings
from tethys_apps.urls import extension_urls
from tethys_portal.views import accoun... | true | true |
1c4adc3e1414a627a27ad7d8b9a75d4ab2509e2d | 4,973 | py | Python | plugins/rapid7_intsights/icon_rapid7_intsights/actions/get_alerts/schema.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | plugins/rapid7_intsights/icon_rapid7_intsights/actions/get_alerts/schema.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | plugins/rapid7_intsights/icon_rapid7_intsights/actions/get_alerts/schema.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Search alerts based on criteria"
class Input:
ALERT_TYPE = "alert_type"
ASSIGNED = "assigned"
FOUND_DATE_FROM = "found_date_from"
FOUND_DATE_TO = "found_date_to"
HAS_INDIC... | 27.174863 | 524 | 0.580736 | import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Search alerts based on criteria"
class Input:
ALERT_TYPE = "alert_type"
ASSIGNED = "assigned"
FOUND_DATE_FROM = "found_date_from"
FOUND_DATE_TO = "found_date_to"
HAS_INDICATORS = "has_indicators"
IS_CLOSED =... | true | true |
1c4adc4be002dfe987da7b17651e87a0b87e7162 | 390 | py | Python | look/urls.py | scotthou94/myinstagram | 7313c89aa38e70c7c4f9b8969d699f850145afca | [
"MIT"
] | null | null | null | look/urls.py | scotthou94/myinstagram | 7313c89aa38e70c7c4f9b8969d699f850145afca | [
"MIT"
] | null | null | null | look/urls.py | scotthou94/myinstagram | 7313c89aa38e70c7c4f9b8969d699f850145afca | [
"MIT"
] | null | null | null | from django.conf.urls import url,include
from . import views
from django.contrib.auth.decorators import login_required
urlpatterns = [
url(r'^$', views.index),
url(r'^discover/', login_required(views.discover)),
url(r'^follow/$', login_required(views.follow), name='follow'),
url(r'^unfollow/(?P<ta... | 32.5 | 90 | 0.694872 | from django.conf.urls import url,include
from . import views
from django.contrib.auth.decorators import login_required
urlpatterns = [
url(r'^$', views.index),
url(r'^discover/', login_required(views.discover)),
url(r'^follow/$', login_required(views.follow), name='follow'),
url(r'^unfollow/(?P<ta... | true | true |
1c4adcf7e64b4d92e082b9ba0e6857c359ce8ed3 | 115 | py | Python | ex030.py | Roninho514/Treinamento-Python | fc6ad0b64fb3dc3cfa5381f8fc53b5b3243a7ff6 | [
"MIT"
] | null | null | null | ex030.py | Roninho514/Treinamento-Python | fc6ad0b64fb3dc3cfa5381f8fc53b5b3243a7ff6 | [
"MIT"
] | null | null | null | ex030.py | Roninho514/Treinamento-Python | fc6ad0b64fb3dc3cfa5381f8fc53b5b3243a7ff6 | [
"MIT"
] | null | null | null | numero = int(input('Digite um número:'))
print('Esse número é par' if numero % 2 == 0 else 'Esse número é impa7r')
| 38.333333 | 73 | 0.678261 | numero = int(input('Digite um número:'))
print('Esse número é par' if numero % 2 == 0 else 'Esse número é impa7r')
| true | true |
1c4adda868e850063084c445480ede3817802d12 | 93,297 | py | Python | python/ray/tests/test_basic.py | gaocegege/ray | 03d05c8765bb6cfd30fdbbcd4577dc22c5dc5af7 | [
"Apache-2.0"
] | 1 | 2019-08-21T08:31:10.000Z | 2019-08-21T08:31:10.000Z | python/ray/tests/test_basic.py | GitAlanWong/ray | c852213b8349b6b9e9e7353573e2259a1b9ef925 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_basic.py | GitAlanWong/ray | c852213b8349b6b9e9e7353573e2259a1b9ef925 | [
"Apache-2.0"
] | 2 | 2019-09-04T13:27:51.000Z | 2019-09-17T04:20:38.000Z | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
from multiprocessing import Process
import os
import random
import re
import setproctitle
import s... | 29.960501 | 79 | 0.60734 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
from multiprocessing import Process
import os
import random
import re
import setproctitle
import shutil
import six... | true | true |
1c4addfb448396b0009dee5101f84c6c363ce2cb | 51,768 | py | Python | pandas/core/indexes/interval.py | Bifaxin/pandas | 2ec7f2f279d770b286c9c7679ba7ad0e2f14dcbe | [
"BSD-3-Clause"
] | 2 | 2019-12-31T14:22:54.000Z | 2019-12-31T14:23:42.000Z | pandas/core/indexes/interval.py | Bifaxin/pandas | 2ec7f2f279d770b286c9c7679ba7ad0e2f14dcbe | [
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/interval.py | Bifaxin/pandas | 2ec7f2f279d770b286c9c7679ba7ad0e2f14dcbe | [
"BSD-3-Clause"
] | null | null | null | """ define the IntervalIndex """
from operator import le, lt
import textwrap
from typing import Any, Optional, Tuple, Union
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import Timedelta, Timestamp, lib
from pandas._libs.interval import Interval, IntervalMixin, IntervalTr... | 33.036375 | 95 | 0.583527 | from operator import le, lt
import textwrap
from typing import Any, Optional, Tuple, Union
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import Timedelta, Timestamp, lib
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
from pandas.util._decorators i... | true | true |
1c4ade2d78bc881c4de7dad09da7fcbf9edec689 | 2,851 | py | Python | auto_generated_scripts/combining_kernels_by_summation.py | myforkmachine/pyprobml | a750b6e33e849ca75300fec1b9ee4b61def80c52 | [
"MIT"
] | null | null | null | auto_generated_scripts/combining_kernels_by_summation.py | myforkmachine/pyprobml | a750b6e33e849ca75300fec1b9ee4b61def80c52 | [
"MIT"
] | null | null | null | auto_generated_scripts/combining_kernels_by_summation.py | myforkmachine/pyprobml | a750b6e33e849ca75300fec1b9ee4b61def80c52 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
try:
import jax
except:
get_ipython().run_line_magic('pip', 'install jax jaxlib')
import jax
import jax.numpy as jnp
try:
import matplotlib.pyplot as plt
except:
get_ipython().run_line_magic('pip', 'install matplotlib')
import matplotlib.pyplot ... | 22.273438 | 64 | 0.619783 |
try:
import jax
except:
get_ipython().run_line_magic('pip', 'install jax jaxlib')
import jax
import jax.numpy as jnp
try:
import matplotlib.pyplot as plt
except:
get_ipython().run_line_magic('pip', 'install matplotlib')
import matplotlib.pyplot as plt
try:
import seaborn as sns
except:
... | true | true |
1c4adea1f2919d3e80db315f58aa9cebace16e2d | 2,724 | py | Python | django/db/migrations/recorder.py | bak1an/django | 98bcc5d81bca578f3a5b4d47907ba4ac40446887 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2021-04-14T20:15:54.000Z | 2021-04-14T20:15:54.000Z | django/db/migrations/recorder.py | djk2/django | 6b00af50146335485d8414c42efec7d8dd5397fc | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/migrations/recorder.py | djk2/django | 6b00af50146335485d8414c42efec7d8dd5397fc | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-02-06T10:31:51.000Z | 2020-02-06T10:31:51.000Z | from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
class MigrationRecorder:
"""
Deals with storing migration records in the database.
Because this table is actua... | 32.819277 | 112 | 0.646843 | from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
class MigrationRecorder:
class Migration(models.Model):
app = models.CharField(max_length=255)
name = ... | true | true |
1c4adf74fe56fbacc2ac8f5384028ec5a33fdee6 | 1,138 | py | Python | flocker/node/test/test_testtools.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/node/test/test_testtools.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/node/test/test_testtools.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Tests for ``flocker.node.testtools``.
"""
from zope.interface import implementer
from twisted.internet.defer import succeed
from .. import sequentially
from ..testtools import (
DummyDeployer, ControllableDeployer, ideployer_tests_factory,
)
from ...... | 24.212766 | 68 | 0.702988 |
from zope.interface import implementer
from twisted.internet.defer import succeed
from .. import sequentially
from ..testtools import (
DummyDeployer, ControllableDeployer, ideployer_tests_factory,
)
from ...control import IClusterStateChange
@implementer(IClusterStateChange)
class DummyClusterStateChange(obj... | true | true |
1c4ae2fc6e24edd3378f495b4123ca7ea576606a | 467 | py | Python | src/python/pants/option/errors.py | hythloday/pants | 107e9b0957f6949ac4bd535fbef8d2d8cba05c5c | [
"Apache-2.0"
] | 11 | 2015-01-20T01:39:41.000Z | 2019-08-08T07:27:44.000Z | src/python/pants/option/errors.py | hythloday/pants | 107e9b0957f6949ac4bd535fbef8d2d8cba05c5c | [
"Apache-2.0"
] | 1 | 2019-08-21T07:29:26.000Z | 2019-08-21T07:29:26.000Z | src/python/pants/option/errors.py | fakeNetflix/square-repo-pants | 28a018c7f47900aec4f576c81a52e0e4b41d9fec | [
"Apache-2.0"
] | 5 | 2015-03-30T02:46:53.000Z | 2018-03-08T20:10:43.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
class RegistrationE... | 27.470588 | 93 | 0.728051 |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
class RegistrationError(Exception):
pass
class ParseError(Exception):
pass
| true | true |
1c4ae493f041362e778734f35d7f5208e5ae65ed | 5,189 | py | Python | tensorflow/python/distribute/keras_metrics_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/keras_metrics_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/keras_metrics_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"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... | 39.015038 | 81 | 0.624976 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.distribute import combinations
from tensorflow.python.distribute import strategy_combinati... | true | true |
1c4ae56e29fb675a37300f165e75394c050cee69 | 108 | py | Python | openstack_manager/conf/constant.py | syunkitada/openstack-manager | d37c611040444352d3947f236f04124e4f548390 | [
"MIT"
] | null | null | null | openstack_manager/conf/constant.py | syunkitada/openstack-manager | d37c611040444352d3947f236f04124e4f548390 | [
"MIT"
] | null | null | null | openstack_manager/conf/constant.py | syunkitada/openstack-manager | d37c611040444352d3947f236f04124e4f548390 | [
"MIT"
] | null | null | null | # coding: utf-8
INIFILE = '/etc/openstack_manager/openstack_manager.conf'
LOG_DOMEIN = 'openstack_manager'
| 21.6 | 57 | 0.787037 |
INIFILE = '/etc/openstack_manager/openstack_manager.conf'
LOG_DOMEIN = 'openstack_manager'
| true | true |
1c4ae5b4e8da20e6eed7f5cfb053c8127923859c | 1,815 | py | Python | experiments/joystick.py | joc-mer/py-tetris-esp32 | cde188b97ebf4f339ff8826ef802d3771a7c952c | [
"BSD-3-Clause"
] | null | null | null | experiments/joystick.py | joc-mer/py-tetris-esp32 | cde188b97ebf4f339ff8826ef802d3771a7c952c | [
"BSD-3-Clause"
] | null | null | null | experiments/joystick.py | joc-mer/py-tetris-esp32 | cde188b97ebf4f339ff8826ef802d3771a7c952c | [
"BSD-3-Clause"
] | null | null | null | from machine import ADC, Pin, SPI
import utime, math
import max7219 # https://github.com/mcauser/micropython-max7219
# ESP32 max7219 8x8 LED Matrix
# 5V VCC
# GND GND
# D2 DIN
# D5 CS
# D4 CLK
# -- set up 8 pix matrices of 8x8 LED (monochrome)
spi = SPI(1, baudrate=10000000, polarity=1, phase=0, sck=P... | 24.527027 | 105 | 0.603857 | from machine import ADC, Pin, SPI
import utime, math
import max7219
spi = SPI(1, baudrate=10000000, polarity=1, phase=0, sck=Pin(4), mosi=Pin(2))
ss = Pin(5, Pin.OUT)
display = max7219.Matrix8x8(spi, ss, 4)
display.fill(0)
display.show()
xPin, yPin, cPin = 34, 32, 27
width = 10
_width = {9:ADC.WIDTH_9BIT, 10:... | true | true |
1c4ae77477d8d3e5166dcacf0aee93a91c200ce5 | 31,826 | py | Python | src/contractExtractor/reentrancyExtractor/judgePath.py | xf97/HuangGai | 40a349be6102d5eb63893fb914659405ae162d93 | [
"MIT"
] | 23 | 2020-09-20T02:10:44.000Z | 2022-03-22T12:58:13.000Z | src/contractExtractor/reentrancyExtractor/judgePath.py | xf97/HuangGai | 40a349be6102d5eb63893fb914659405ae162d93 | [
"MIT"
] | 3 | 2020-09-22T15:28:33.000Z | 2022-01-22T07:48:53.000Z | src/contractExtractor/reentrancyExtractor/judgePath.py | xf97/HuangGai | 40a349be6102d5eb63893fb914659405ae162d93 | [
"MIT"
] | 5 | 2021-07-15T02:45:09.000Z | 2022-03-21T13:36:40.000Z | #!/usr/bin/python
#-*- coding: utf-8 -*-
'''
该部分程序用于判断目标合约是否包含目标路径
如果包含,则需要保存目标路径
'''
'''
可用工具:slither真是个宝藏工具
slither可能可用的功能:
合约各个函数的调用图
文件中各个合约的继承关系
最子类合约的构造函数执行结果
function-summary里有每个函数读写、内外部调用的总结
human-summary里有对每个合约功能的概述->可以用来判断->不能用来判断,对于Receive ETH而言,只判断payable关键字而不判断合约是否真的可以接收以太币
require显示出每个合约的每个函数中用到的requir... | 32.115035 | 153 | 0.68532 |
import subprocess
import os
from inherGraph import inherGraph from colorPrint import * from pydot import io import re
import json
CACHE_PATH = "./cache/"
TERMINAL_FILE = "log.txt"
INJECT_INFO_PATH = "./result/"
TUPLE_FLAG = "tuple()"
REQUIRE_FUNC_TYPE_FLAG = "function (bool) pure"
REQUIRE_FUNC_STRING_TYPE_FLAG = "f... | true | true |
1c4ae85a0d8d9e82d0383f1b99a36ec9586665d4 | 8,662 | py | Python | homeassistant/components/xiaomi_miio/remote.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 1 | 2019-02-18T03:16:32.000Z | 2019-02-18T03:16:32.000Z | homeassistant/components/xiaomi_miio/remote.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:29:36.000Z | 2022-03-12T00:59:48.000Z | homeassistant/components/xiaomi_miio/remote.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 1 | 2019-09-28T07:06:08.000Z | 2019-09-28T07:06:08.000Z | """Support for the Xiaomi IR Remote (Chuangmi IR)."""
import asyncio
import logging
import time
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.remote import (
PLATFORM_SCHEMA, DOMAIN, ATTR_NUM_REPEATS, ATTR_DELAY_SECS,
DEFAULT_DELAY_SECS, RemoteDevice)
from homeassistan... | 33.187739 | 79 | 0.625491 | import asyncio
import logging
import time
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.remote import (
PLATFORM_SCHEMA, DOMAIN, ATTR_NUM_REPEATS, ATTR_DELAY_SECS,
DEFAULT_DELAY_SECS, RemoteDevice)
from homeassistant.const import (
CONF_NAME, CONF_HOST, CONF_TOKEN,... | true | true |
1c4ae8c514ee7ef6422e7f7a69e4e366db683d91 | 6,151 | py | Python | conditional/util/member.py | jabbate19/conditional | 20013459438d80bca06a844da250e2543c84186e | [
"MIT"
] | 9 | 2016-08-21T19:27:24.000Z | 2019-09-12T06:56:49.000Z | conditional/util/member.py | jabbate19/conditional | 20013459438d80bca06a844da250e2543c84186e | [
"MIT"
] | 237 | 2016-08-21T18:08:58.000Z | 2022-03-28T17:01:36.000Z | conditional/util/member.py | jabbate19/conditional | 20013459438d80bca06a844da250e2543c84186e | [
"MIT"
] | 31 | 2016-08-22T23:46:48.000Z | 2022-03-26T22:37:39.000Z | from datetime import datetime
from conditional import start_of_year
from conditional.models.models import CommitteeMeeting
from conditional.models.models import CurrentCoops
from conditional.models.models import FreshmanEvalData
from conditional.models.models import HouseMeeting
from conditional.models.models import M... | 37.969136 | 98 | 0.688506 | from datetime import datetime
from conditional import start_of_year
from conditional.models.models import CommitteeMeeting
from conditional.models.models import CurrentCoops
from conditional.models.models import FreshmanEvalData
from conditional.models.models import HouseMeeting
from conditional.models.models import M... | true | true |
1c4aea51c99be63d27dd8fd9ab6ca5dbffa66cae | 176,012 | py | Python | galois/_fields/_main.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | galois/_fields/_main.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | galois/_fields/_main.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | """
A module that contains the main classes for Galois fields -- FieldClass, FieldArray,
and Poly. They're all in one file because they have circular dependencies. The specific GF2
FieldClass is also included.
"""
import inspect
import math
import random
from typing import Tuple, List, Sequence, Iterable, Optional, Uni... | 36.845719 | 428 | 0.55853 | import inspect
import math
import random
from typing import Tuple, List, Sequence, Iterable, Optional, Union
from typing_extensions import Literal
import numba
import numpy as np
from .._factor import divisors
from .._overrides import set_module
from .._poly_conversion import integer_to_poly, poly_to_integer, str_to_... | true | true |
1c4aea5dca4be7bf3e49a80f9d93695e5aff40c9 | 8,347 | py | Python | cwmud/contrib/worldgen/terrain.py | whutch/cwmud | bee8b126a5e70edd0593dae9753a6be8d52357cf | [
"MIT"
] | 11 | 2016-03-03T03:56:59.000Z | 2021-11-19T15:38:51.000Z | cwmud/contrib/worldgen/terrain.py | whutch/atria | bee8b126a5e70edd0593dae9753a6be8d52357cf | [
"MIT"
] | 26 | 2016-08-31T23:19:45.000Z | 2019-10-19T21:50:33.000Z | cwmud/contrib/worldgen/terrain.py | whutch/atria | bee8b126a5e70edd0593dae9753a6be8d52357cf | [
"MIT"
] | 2 | 2016-01-22T21:22:34.000Z | 2016-02-09T06:03:57.000Z | # -*- coding: utf-8 -*-
"""Terrain types and management."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 Will Hutcheson
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
from os.path import dirname, exists, join
from ...core.attributes import U... | 36.933628 | 77 | 0.623697 |
from os.path import dirname, exists, join
from ...core.attributes import Unset
from ...core.entities import Attribute
from ...core.logs import get_logger
from ...core.utils.exceptions import AlreadyExists
from ...core.world import Room
log = get_logger("worldgen")
class TerrainManager:
def __init__(self):
... | true | true |
1c4aeb13d345d58019753e98b9a30dd9ea37b2fd | 3,440 | py | Python | src/wallabag/wallabag_show.py | davidhelbig/wallabag-cli | 0324138593c836e7371450262c14f207445bb921 | [
"MIT"
] | 3 | 2020-04-22T05:08:49.000Z | 2020-07-30T18:43:10.000Z | src/wallabag/wallabag_show.py | davidhelbig/wallabag-cli | 0324138593c836e7371450262c14f207445bb921 | [
"MIT"
] | null | null | null | src/wallabag/wallabag_show.py | davidhelbig/wallabag-cli | 0324138593c836e7371450262c14f207445bb921 | [
"MIT"
] | 3 | 2020-04-23T18:30:04.000Z | 2020-10-14T14:57:59.000Z | """
Show a wallabag entry
"""
import io
import formatter
import json
import os
from sys import exit
import sys
from bs4 import BeautifulSoup
from . import api
from . import conf
from . import entry
def show(entry_id, colors=True, raw=False, html=False):
"""
Main function for showing an entry.
"""
con... | 26.461538 | 98 | 0.581977 | import io
import formatter
import json
import os
from sys import exit
import sys
from bs4 import BeautifulSoup
from . import api
from . import conf
from . import entry
def show(entry_id, colors=True, raw=False, html=False):
conf.load()
try:
request = api.api_get_entry(entry_id)
__handle_reque... | true | true |
1c4aec00bc23d2f212b4cd3654c3fd79517543b8 | 1,672 | py | Python | tests/cpu/test_layer_norm.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | 322 | 2020-05-08T04:03:51.000Z | 2022-03-30T13:01:31.000Z | tests/cpu/test_layer_norm.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | 159 | 2020-05-09T02:55:40.000Z | 2022-03-30T13:43:04.000Z | tests/cpu/test_layer_norm.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | 64 | 2020-05-08T03:49:27.000Z | 2022-03-22T09:50:23.000Z | import unittest
import torch
import intel_extension_for_pytorch as ipex
from common_utils import TestCase
class M1(torch.nn.Module):
def __init__(self):
super(M1, self).__init__()
self.conv = torch.nn.Conv2d(5, 5, 1, stride=1, bias=False)
self.layer_norm = torch.nn.LayerNorm(10... | 31.54717 | 67 | 0.585526 | import unittest
import torch
import intel_extension_for_pytorch as ipex
from common_utils import TestCase
class M1(torch.nn.Module):
def __init__(self):
super(M1, self).__init__()
self.conv = torch.nn.Conv2d(5, 5, 1, stride=1, bias=False)
self.layer_norm = torch.nn.LayerNorm(10... | true | true |
1c4aec3a579fd4b1fab905c16e68050e23f9625c | 1,087 | py | Python | route/user_count_edit.py | k0000k/openNAMU | b5862a7e5a1f1a2a6bee5eec5b3d9784528f42e8 | [
"BSD-3-Clause"
] | 126 | 2019-01-16T01:02:34.000Z | 2021-07-04T14:16:40.000Z | route/user_count_edit.py | k0000k/openNAMU | b5862a7e5a1f1a2a6bee5eec5b3d9784528f42e8 | [
"BSD-3-Clause"
] | 454 | 2018-12-02T10:03:37.000Z | 2021-07-13T11:31:42.000Z | route/user_count_edit.py | k0000k/openNAMU | b5862a7e5a1f1a2a6bee5eec5b3d9784528f42e8 | [
"BSD-3-Clause"
] | 102 | 2018-12-02T11:49:54.000Z | 2021-06-30T10:52:53.000Z | from .tool.func import *
def user_count_edit_2(conn, name):
curs = conn.cursor()
if name == None:
that = ip_check()
else:
that = name
curs.execute(db_change("select count(*) from history where ip = ?"), [that])
count = curs.fetchall()
if count:
data = count[0][0]
e... | 31.970588 | 151 | 0.50598 | from .tool.func import *
def user_count_edit_2(conn, name):
curs = conn.cursor()
if name == None:
that = ip_check()
else:
that = name
curs.execute(db_change("select count(*) from history where ip = ?"), [that])
count = curs.fetchall()
if count:
data = count[0][0]
e... | true | true |
1c4aee0bd841408284417e7a4b3eeb4380477e57 | 5,814 | py | Python | eval.py | Luoyadan/BGNN-AAAI | 16bd260b93009be27932415e74ce1b3128215d92 | [
"MIT"
] | 52 | 2019-12-11T08:25:11.000Z | 2021-12-26T09:32:56.000Z | eval.py | UQMM/BGNN-AAAI | 16bd260b93009be27932415e74ce1b3128215d92 | [
"MIT"
] | 3 | 2020-02-17T03:37:17.000Z | 2021-06-09T09:22:10.000Z | eval.py | UQMM/BGNN-AAAI | 16bd260b93009be27932415e74ce1b3128215d92 | [
"MIT"
] | 16 | 2020-01-15T06:42:30.000Z | 2021-08-30T05:59:43.000Z | import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1"
from torchtools import *
from data import MiniImagenetLoader, TieredImagenetLoader
from model import EmbeddingImagenet, GraphNetwork, ConvNet
import shutil
import os
import random
from train import ModelTrainer
if __name... | 35.668712 | 132 | 0.659615 | import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1"
from torchtools import *
from data import MiniImagenetLoader, TieredImagenetLoader
from model import EmbeddingImagenet, GraphNetwork, ConvNet
import shutil
import os
import random
from train import ModelTrainer
if __name... | true | true |
1c4aee7999da36da005471a52b1815e649767373 | 66,724 | py | Python | feapder/utils/tools.py | gyco/feapder | 6d7f6f318b3dd93168cbd76d9ba165b04285a05e | [
"MIT"
] | null | null | null | feapder/utils/tools.py | gyco/feapder | 6d7f6f318b3dd93168cbd76d9ba165b04285a05e | [
"MIT"
] | null | null | null | feapder/utils/tools.py | gyco/feapder | 6d7f6f318b3dd93168cbd76d9ba165b04285a05e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on 2018-09-06 14:21
---------
@summary: 工具
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import asyncio
import base64
import calendar
import codecs
import configparser # 读配置文件的
import datetime
import functools
import hashlib
import html
import json
import os
import pick... | 24.795243 | 145 | 0.562601 | import asyncio
import base64
import calendar
import codecs
import configparser import datetime
import functools
import hashlib
import html
import json
import os
import pickle
import random
import re
import signal
import socket
import ssl
import string
import sys
import time
import traceback
import urllib
import urllib... | true | true |
1c4aeeff8024ba7316b92e3705770ea7212291c0 | 2,664 | py | Python | folklore/log.py | maralla/folklore | 851aded3db130a84d3a9c1bb581cdaad12e5b5a1 | [
"MIT"
] | null | null | null | folklore/log.py | maralla/folklore | 851aded3db130a84d3a9c1bb581cdaad12e5b5a1 | [
"MIT"
] | null | null | null | folklore/log.py | maralla/folklore | 851aded3db130a84d3a9c1bb581cdaad12e5b5a1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
folklore.log
~~~~~~~~~~~~
This module implements log configuration.
Hook definition:
- init_process Config logs
"""
import sys
import logging
import logging.config
from copy import deepcopy
from .hook import define_hook
CONF = {
'version': 1,
'disable_existing_loggers': F... | 23.575221 | 74 | 0.563438 |
import sys
import logging
import logging.config
from copy import deepcopy
from .hook import define_hook
CONF = {
'version': 1,
'disable_existing_loggers': False,
'root': None,
'loggers': {},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHand... | true | true |
1c4aef1e83c2ef8ee4a5a277c50748c34c3b41ea | 6,388 | py | Python | casemgmt/models.py | devmonkey22/oso-casemgmt-django | 2a5d455015394f95716ba6c62daf330fbdb6fd6a | [
"MIT"
] | 3 | 2020-12-18T13:52:16.000Z | 2021-02-17T17:05:28.000Z | casemgmt/models.py | devmonkey22/oso-casemgmt-django | 2a5d455015394f95716ba6c62daf330fbdb6fd6a | [
"MIT"
] | 1 | 2021-04-13T18:58:17.000Z | 2021-04-13T18:58:17.000Z | casemgmt/models.py | devmonkey22/oso-casemgmt-django | 2a5d455015394f95716ba6c62daf330fbdb6fd6a | [
"MIT"
] | 2 | 2020-12-21T15:10:29.000Z | 2021-02-17T19:22:05.000Z | from django.contrib.auth.models import AbstractUser, Group, Permission, GroupManager
from django.db import models
from django_oso.models import AuthorizedModel
## MODELS ##
class User(AbstractUser):
"""
System users as Case Workers, Supervisors, Auditors, etc.
"""
# basic info
email = models.Char... | 32.758974 | 129 | 0.705855 | from django.contrib.auth.models import AbstractUser, Group, Permission, GroupManager
from django.db import models
from django_oso.models import AuthorizedModel
class User(AbstractUser):
email = models.CharField(max_length=256)
class Role(models.Model):
name = models.CharField(max_length=150, unique=Tru... | true | true |
1c4aef25deb00cfd4a6a12c8bfa8ad3d271e90a6 | 7,367 | py | Python | onmt/train_single.py | iacercalixto/WALS | 7f4b5042591d536f6b371d5fb252616d2da7abaf | [
"MIT"
] | 1 | 2019-12-19T09:47:35.000Z | 2019-12-19T09:47:35.000Z | onmt/train_single.py | iacercalixto/WALS | 7f4b5042591d536f6b371d5fb252616d2da7abaf | [
"MIT"
] | null | null | null | onmt/train_single.py | iacercalixto/WALS | 7f4b5042591d536f6b371d5fb252616d2da7abaf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Training on a single process
"""
from __future__ import division
import argparse
import os
import random
import torch
import onmt.opts as opts
from onmt.inputters.inputter import build_dataset_iter, lazily_load_dataset, \
_load_fields, _collect_report_features
from onmt.model_builde... | 33.334842 | 181 | 0.681146 | from __future__ import division
import argparse
import os
import random
import torch
import onmt.opts as opts
from onmt.inputters.inputter import build_dataset_iter, lazily_load_dataset, \
_load_fields, _collect_report_features
from onmt.model_builder import build_model
from onmt.utils.optimizers import build_op... | true | true |
1c4aef758d67003c0f78c72def5acfed40ba9f4c | 271 | py | Python | upol_search_engine/upol_crawler/tools/blacklist.py | UPOLSearch/UPOL-Search-Engine | 791f0a4a01b4d034637ee6dba4cfd254ae8f3f50 | [
"MIT"
] | 1 | 2022-02-02T17:49:23.000Z | 2022-02-02T17:49:23.000Z | upol_search_engine/upol_crawler/tools/blacklist.py | UPOLSearch/UPOL-Search-Engine | 791f0a4a01b4d034637ee6dba4cfd254ae8f3f50 | [
"MIT"
] | 5 | 2017-10-09T09:23:32.000Z | 2017-11-13T08:17:08.000Z | upol_search_engine/upol_crawler/tools/blacklist.py | UPOLSearch/UPOL-Search-Engine | 791f0a4a01b4d034637ee6dba4cfd254ae8f3f50 | [
"MIT"
] | null | null | null | from upol_search_engine.utils import urls
def generate_blacklist(text):
return urls.load_urls_from_text(text)
def is_url_blocked(url, blacklist):
"""Check if url domain is blocked"""
if urls.domain(url) in blacklist:
return True
return False
| 19.357143 | 41 | 0.723247 | from upol_search_engine.utils import urls
def generate_blacklist(text):
return urls.load_urls_from_text(text)
def is_url_blocked(url, blacklist):
if urls.domain(url) in blacklist:
return True
return False
| true | true |
1c4af083e638bd57ce552a8c2584676de6b169bc | 2,063 | py | Python | longclaw/orders/tests.py | MstatiliS/longclaw | 874e35ece3710d1c30ebdadfec9708caa9b6553f | [
"MIT"
] | null | null | null | longclaw/orders/tests.py | MstatiliS/longclaw | 874e35ece3710d1c30ebdadfec9708caa9b6553f | [
"MIT"
] | null | null | null | longclaw/orders/tests.py | MstatiliS/longclaw | 874e35ece3710d1c30ebdadfec9708caa9b6553f | [
"MIT"
] | null | null | null | import mock
from django.test import TestCase
from django.contrib.auth.models import User
from django.urls import reverse_lazy
from django.contrib.auth.models import User
from wagtail.tests.utils import WagtailTestUtils
from longclaw.tests.utils import LongclawTestCase, OrderFactory
from longclaw.orders.wagtail_hooks im... | 34.966102 | 88 | 0.709646 | import mock
from django.test import TestCase
from django.contrib.auth.models import User
from django.urls import reverse_lazy
from django.contrib.auth.models import User
from wagtail.tests.utils import WagtailTestUtils
from longclaw.tests.utils import LongclawTestCase, OrderFactory
from longclaw.orders.wagtail_hooks im... | true | true |
1c4af096765c70ceabadb35d49d28ebfd65052eb | 3,510 | py | Python | test/functional/mempool_compatibility.py | Darrenshome40/shitecoin | a2535c8fc5a43ee21ec818d5367439f6302cd084 | [
"MIT"
] | null | null | null | test/functional/mempool_compatibility.py | Darrenshome40/shitecoin | a2535c8fc5a43ee21ec818d5367439f6302cd084 | [
"MIT"
] | null | null | null | test/functional/mempool_compatibility.py | Darrenshome40/shitecoin | a2535c8fc5a43ee21ec818d5367439f6302cd084 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The shitecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that mempool.dat is both backward and forward compatible between versions
NOTE: The test is des... | 41.294118 | 114 | 0.71567 |
import os
from test_framework.test_framework import shitecoinTestFramework
from test_framework.wallet import MiniWallet
class MempoolCompatibilityTest(shitecoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.wallet_names = [None]
def skip_test_if_missing_module(self):
... | true | true |
1c4af0f60e6d67d8d5a2ad58f0c9b68d92d1c96e | 3,583 | py | Python | tensorflow_toolkit/image_retrieval/image_retrieval/common.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 256 | 2020-09-09T03:27:57.000Z | 2022-03-30T10:06:06.000Z | tensorflow_toolkit/image_retrieval/image_retrieval/common.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 604 | 2020-09-08T12:29:49.000Z | 2022-03-31T21:51:08.000Z | tensorflow_toolkit/image_retrieval/image_retrieval/common.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 160 | 2020-09-09T14:06:07.000Z | 2022-03-30T14:50:48.000Z | """
Copyright (c) 2019 Intel Corporation
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 wri... | 28.895161 | 100 | 0.642757 |
import os
import numpy as np
import cv2
def max_central_square_crop(image):
height, width = image.shape[:2]
if width > height:
image = image[:, (width - height) // 2:(width - height) // 2 + height]
else:
image = image[(height - width) // 2:(height - width) // 2 + width, :]
return ... | true | true |
1c4af275adaa05ba77c5b648c0a78fd0044d8040 | 9,891 | py | Python | src/webapp/azext_webapp/custom.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | src/webapp/azext_webapp/custom.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | src/webapp/azext_webapp/custom.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.2125 | 108 | 0.663937 |
from __future__ import print_function
import json
from knack.log import get_logger
from azure.mgmt.web.models import (AppServicePlan, SkuDescription)
from azure.cli.command_modules.appservice.custom import (
enable_zip_deploy,
create_webapp,
update_app_settings,
_get_site_credential,
_get_scm_url,
... | true | true |
1c4af3134b3e34c42733d1345933b4cd1aa8b0eb | 342 | py | Python | pylib/os_path_test.py | bvberkum/oil | 8b93aeda9e8da8af790d747fcb11d00a673eb58c | [
"Apache-2.0"
] | null | null | null | pylib/os_path_test.py | bvberkum/oil | 8b93aeda9e8da8af790d747fcb11d00a673eb58c | [
"Apache-2.0"
] | null | null | null | pylib/os_path_test.py | bvberkum/oil | 8b93aeda9e8da8af790d747fcb11d00a673eb58c | [
"Apache-2.0"
] | 1 | 2021-03-06T22:08:23.000Z | 2021-03-06T22:08:23.000Z | #!/usr/bin/env python2
"""
os_path_test.py: Tests for os_path.py
"""
from __future__ import print_function
import unittest
from pylib import os_path # module under test
class OsPathTest(unittest.TestCase):
def testBasename(self):
self.assertEqual('bar', os_path.basename('foo/bar'))
if __name__ == '__main_... | 17.1 | 56 | 0.733918 | from __future__ import print_function
import unittest
from pylib import os_path
class OsPathTest(unittest.TestCase):
def testBasename(self):
self.assertEqual('bar', os_path.basename('foo/bar'))
if __name__ == '__main__':
unittest.main()
| true | true |
1c4af34de1b3fe4ed1ff6c877d7aaa3d3b36f519 | 295 | py | Python | llvm_headers/conanfile.py | Manu343726/clang-conan-packages | 4739985e95d4b0cc3f682ad0c7f5229697584136 | [
"MIT"
] | 5 | 2020-01-16T09:42:22.000Z | 2021-06-24T03:33:29.000Z | recipes/llvm_headers/conanfile.py | bincrafters/conan-llvm | caa0f2da0086978b88631df6a545a13819588407 | [
"MIT"
] | 3 | 2020-01-16T00:04:32.000Z | 2020-01-16T01:38:59.000Z | llvm_headers/conanfile.py | Manu343726/clang-conan-packages | 4739985e95d4b0cc3f682ad0c7f5229697584136 | [
"MIT"
] | 2 | 2020-04-06T23:08:59.000Z | 2020-05-28T06:25:33.000Z | from conans import python_requires
common = python_requires('llvm-common/0.0.0@Manu343726/testing')
class LLVMHeaders(common.LLVMModulePackage):
version = common.LLVMModulePackage.version
name = 'llvm_headers'
llvm_component = 'llvm'
header_only = True
include_dirs = ['']
| 26.818182 | 64 | 0.742373 | from conans import python_requires
common = python_requires('llvm-common/0.0.0@Manu343726/testing')
class LLVMHeaders(common.LLVMModulePackage):
version = common.LLVMModulePackage.version
name = 'llvm_headers'
llvm_component = 'llvm'
header_only = True
include_dirs = ['']
| true | true |
1c4af46bbed39d9dc35000b7d9f4aea79877771f | 4,760 | py | Python | logger.py | HaoranZ99/RL-2 | 253c2fd8c705f88d9cc79abd9f331dc99b5895eb | [
"MIT"
] | null | null | null | logger.py | HaoranZ99/RL-2 | 253c2fd8c705f88d9cc79abd9f331dc99b5895eb | [
"MIT"
] | null | null | null | logger.py | HaoranZ99/RL-2 | 253c2fd8c705f88d9cc79abd9f331dc99b5895eb | [
"MIT"
] | null | null | null | import numpy as np
import time, datetime
import matplotlib.pyplot as plt
class Logger():
def __init__(self, save_dir):
self.save_log = save_dir / "log"
with open(self.save_log, "w") as f:
f.write(
f"{'Episode':>8}{'Step':>8}{'Epsilon':>10}{'MeanReward':>15}"
... | 37.480315 | 101 | 0.576471 | import numpy as np
import time, datetime
import matplotlib.pyplot as plt
class Logger():
def __init__(self, save_dir):
self.save_log = save_dir / "log"
with open(self.save_log, "w") as f:
f.write(
f"{'Episode':>8}{'Step':>8}{'Epsilon':>10}{'MeanReward':>15}"
... | true | true |
1c4af486fea5fc7d523969abc73ef3add41db54f | 7,727 | py | Python | src/aks-preview/azext_aks_preview/commands.py | xiazhan/azure-cli-extensions | fa33dba098c1c4aa7624a9d8393722a9dabd050a | [
"MIT"
] | null | null | null | src/aks-preview/azext_aks_preview/commands.py | xiazhan/azure-cli-extensions | fa33dba098c1c4aa7624a9d8393722a9dabd050a | [
"MIT"
] | 1 | 2021-07-12T22:10:21.000Z | 2021-07-12T22:10:21.000Z | src/aks-preview/azext_aks_preview/commands.py | xiazhan/azure-cli-extensions | fa33dba098c1c4aa7624a9d8393722a9dabd050a | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 56.40146 | 142 | 0.711143 |
from azure.cli.core.commands import CliCommandType
from ._client_factory import cf_managed_clusters
from ._client_factory import cf_maintenance_configurations
from ._client_factory import cf_container_services
from ._client_factory import cf_agent_pools
from ._format import aks_show_table_format
from ._format import ... | true | true |
1c4af53588d57359ae6d05b519a1dc4f2f7ca79b | 1,981 | py | Python | ampel/mongo/query/general.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | ampel/mongo/query/general.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | ampel/mongo/query/general.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: Ampel-core/ampel/mongo/query/general.py
# License: BSD-3-Clause
# Author: valery brinnel <firstname.lastname@gmail.com>
# Date: 11.12.2019
# Last Modified Date: 17.02.2021
# Last Modified By: valery brinnel ... | 36.018182 | 112 | 0.710752 |
from bson.int64 import Int64
from typing import Any, Literal
from ampel.types import Tag, ChannelId, StockId, StrictIterable
from ampel.model.operator.AnyOf import AnyOf
from ampel.model.operator.AllOf import AllOf
from ampel.model.operator.OneOf import OneOf
from ampel.mongo.utils import maybe_match_array
from ampel.... | true | true |
1c4af5509e74f37a845df6918bcfcc8286f347c3 | 307 | py | Python | PycharmProjects/PythonExercicios/ex030.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | PycharmProjects/PythonExercicios/ex030.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | PycharmProjects/PythonExercicios/ex030.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | #Crie um programa que leia um número inteiro e mostre na tela se ele é PAR ou ÍMPAR
num = input('Digite um número inteiro, e eu vou lhe dizer se ele é par ou impar: ').strip()
num = int(num)
if num % 2 == 0:
print(f'O número {num} é um número par.')
else:
print(f'O número {num} é um número impar.') | 43.857143 | 91 | 0.674267 | num = input('Digite um número inteiro, e eu vou lhe dizer se ele é par ou impar: ').strip()
num = int(num)
if num % 2 == 0:
print(f'O número {num} é um número par.')
else:
print(f'O número {num} é um número impar.') | true | true |
1c4af5a3dd37ea59624418f4740c2e857872d948 | 9,018 | py | Python | backend/cookie/cookie/config/settings/production.py | NehemiasEC/BS | 7ce92a4efd7522f2ee7b35cce7620c3d125510ca | [
"MIT"
] | 1 | 2020-05-27T03:56:02.000Z | 2020-05-27T03:56:02.000Z | backend/cookie/cookie/config/settings/production.py | NehemiasEC/BS | 7ce92a4efd7522f2ee7b35cce7620c3d125510ca | [
"MIT"
] | 21 | 2020-05-28T06:23:37.000Z | 2022-03-12T00:51:49.000Z | backend/cookie/cookie/config/settings/production.py | NehemiasEC/BS | 7ce92a4efd7522f2ee7b35cce7620c3d125510ca | [
"MIT"
] | null | null | null | import logging
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.celery import CeleryIntegration
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------... | 41.944186 | 100 | 0.634952 | import logging
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.celery import CeleryIntegration
from .base import * from .base import env
SECRET_KEY = env("DJANGO_SECRET_KEY")
ALLOWED_HOSTS = e... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.