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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c1e53894acb2dd908ecc33d8fdaa91ff39a59be | 210 | py | Python | wouldyouci_database/crawling/onetry.py | jhee514/wouldYouCi | 54793401fb51356587e5a4460eb606ed9943b30c | [
"MIT"
] | 1 | 2020-06-18T08:40:47.000Z | 2020-06-18T08:40:47.000Z | wouldyouci_database/crawling/onetry.py | jhee514/wouldYouCi | 54793401fb51356587e5a4460eb606ed9943b30c | [
"MIT"
] | 14 | 2021-03-19T08:55:06.000Z | 2022-03-12T00:37:51.000Z | wouldyouci_database/crawling/onetry.py | jhee514/wouldYouCi | 54793401fb51356587e5a4460eb606ed9943b30c | [
"MIT"
] | 1 | 2021-05-27T08:52:01.000Z | 2021-05-27T08:52:01.000Z | import movie_on_ci
import match_code
import movie_code_change
import movie_on_today
movie_on_today.getScreenInfo()
movie_on_ci.getScreenInfo()
match_code.matchingMovieCode()
movie_code_change.movieCodeChange() | 23.333333 | 35 | 0.885714 | import movie_on_ci
import match_code
import movie_code_change
import movie_on_today
movie_on_today.getScreenInfo()
movie_on_ci.getScreenInfo()
match_code.matchingMovieCode()
movie_code_change.movieCodeChange() | true | true |
1c1e53df2f4264e1d989c7afbe35e12f2f475889 | 1,337 | py | Python | resources/examples/race-benchmark.py | kymmie777/Turb-intrudR | 1028f48053c3641bb279d70240452d20f6248555 | [
"Apache-2.0"
] | 890 | 2019-01-19T21:51:05.000Z | 2022-03-31T18:20:44.000Z | resources/examples/race-benchmark.py | kymmie777/Turb-intrudR | 1028f48053c3641bb279d70240452d20f6248555 | [
"Apache-2.0"
] | 85 | 2019-01-22T17:14:15.000Z | 2022-03-01T08:10:36.000Z | resources/examples/race-benchmark.py | kymmie777/Turb-intrudR | 1028f48053c3641bb279d70240452d20f6248555 | [
"Apache-2.0"
] | 166 | 2019-01-20T01:45:37.000Z | 2022-03-19T12:16:34.000Z | from decimal import *
def queueRequests(target, wordlists):
req = '''GET /time.php HTTP/1.1
Host: portswigger-labs.net
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) Gecko/20100101 Firefox/67.0
Connection: keep-alive
'''
windo... | 28.446809 | 94 | 0.596111 | from decimal import *
def queueRequests(target, wordlists):
req = '''GET /time.php HTTP/1.1
Host: portswigger-labs.net
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) Gecko/20100101 Firefox/67.0
Connection: keep-alive
'''
windo... | false | true |
1c1e553911ed903f9936dd9f9e63bb505cdf121c | 19,773 | py | Python | bc/standardpages/migrations/0017_add_detail_to_storyblock.py | Buckinghamshire-Digital-Service/buckinghamshire-council | bbbdb52b515bcdfc79a2bd9198dfa4828405370e | [
"BSD-3-Clause"
] | 1 | 2021-02-27T07:27:17.000Z | 2021-02-27T07:27:17.000Z | bc/standardpages/migrations/0017_add_detail_to_storyblock.py | Buckinghamshire-Digital-Service/buckinghamshire-council | bbbdb52b515bcdfc79a2bd9198dfa4828405370e | [
"BSD-3-Clause"
] | null | null | null | bc/standardpages/migrations/0017_add_detail_to_storyblock.py | Buckinghamshire-Digital-Service/buckinghamshire-council | bbbdb52b515bcdfc79a2bd9198dfa4828405370e | [
"BSD-3-Clause"
] | 1 | 2021-06-09T15:56:54.000Z | 2021-06-09T15:56:54.000Z | # Generated by Django 2.2.13 on 2020-06-16 15:50
from django.db import migrations
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
("standardp... | 59.378378 | 139 | 0.161786 |
from django.db import migrations
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
("standardpages", "0016_add_accordion_to_storyblock"),
... | true | true |
1c1e56012bdcc40d2a1f1da370a57eb572390e0e | 10,687 | py | Python | packages/python/yapkernel/yapkernel/yap.py | guicho271828/yap | 72dac728ec8c5f02d1e2c216939382e084920356 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 27 | 2020-11-16T17:25:33.000Z | 2022-03-04T23:38:03.000Z | packages/python/yapkernel/yapkernel/yap.py | guicho271828/yap | 72dac728ec8c5f02d1e2c216939382e084920356 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 7 | 2020-11-23T22:19:09.000Z | 2022-03-30T09:08:51.000Z | packages/python/yapkernel/yapkernel/yap.py | guicho271828/yap | 72dac728ec8c5f02d1e2c216939382e084920356 | [
"Artistic-1.0-Perl",
"ClArtistic"
] | 5 | 2020-11-24T11:52:23.000Z | 2021-11-25T19:48:51.000Z |
class YAPRun(InteractiveShell):
"""An enhanced, interactive shell for YAP."""
def __init__(self, shell):
self.shell = shell
self.engine = JupyterEngine()
global engine
engine = self.engine
self.errors = []
self.q = None
self.os = None
self.it = N... | 32.883077 | 152 | 0.534949 |
class YAPRun(InteractiveShell):
def __init__(self, shell):
self.shell = shell
self.engine = JupyterEngine()
global engine
engine = self.engine
self.errors = []
self.q = None
self.os = None
self.it = None
self.port = "None"
self.answer... | true | true |
1c1e587cc6be0303110dbfa8bd6f70cc38c04edf | 5,279 | py | Python | tests/operators/test_from.py | andreax79/airflow-provider-xlsx | 89ce580de759888f8e66173412880b77b06a9a6b | [
"Apache-2.0"
] | 1 | 2021-09-03T09:20:52.000Z | 2021-09-03T09:20:52.000Z | tests/operators/test_from.py | andreax79/airflow-provider-xlsx | 89ce580de759888f8e66173412880b77b06a9a6b | [
"Apache-2.0"
] | 1 | 2021-08-30T08:41:01.000Z | 2021-08-30T08:41:01.000Z | tests/operators/test_from.py | andreax79/airflow-provider-xlsx | 89ce580de759888f8e66173412880b77b06a9a6b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import csv
import json
import os.path
import shutil
import tempfile
import pyarrow.parquet
from unittest import TestCase, main
from xlsx_provider.operators.from_xlsx_operator import FromXLSXOperator
TEST_DATA = [
['One', '2021-09-07 00:00:00', '10', '1', '10', '0.0001'],
['Two'... | 29.994318 | 85 | 0.520364 |
import os
import csv
import json
import os.path
import shutil
import tempfile
import pyarrow.parquet
from unittest import TestCase, main
from xlsx_provider.operators.from_xlsx_operator import FromXLSXOperator
TEST_DATA = [
['One', '2021-09-07 00:00:00', '10', '1', '10', '0.0001'],
['Two', '2011-09-08 00:00:0... | true | true |
1c1e59ab57564bcd9255fefa13848d8bf529fa4b | 3,218 | py | Python | app/db/payment.py | codelableidenvelux/agestudy | 8bc688c99f48e8b4c7acd4300c52bd705c1ac3c7 | [
"MIT"
] | 1 | 2020-06-11T07:33:02.000Z | 2020-06-11T07:33:02.000Z | app/db/payment.py | codelableidenvelux/agestudy | 8bc688c99f48e8b4c7acd4300c52bd705c1ac3c7 | [
"MIT"
] | 17 | 2020-03-17T19:55:47.000Z | 2020-03-23T16:59:39.000Z | app/db/payment.py | codelableidenvelux/agestudy | 8bc688c99f48e8b4c7acd4300c52bd705c1ac3c7 | [
"MIT"
] | 1 | 2020-06-11T07:33:09.000Z | 2020-06-11T07:33:09.000Z | from postgresql import Db
from datetime import datetime, timedelta
db = Db("")
def calculate_payment(id):
"""
Calculate the total amount of money the user has earned since last payment collection
"""
# get the completed tasks where the user has not completed payment
select = f"SELECT * FROM ... | 44.082192 | 129 | 0.611871 | from postgresql import Db
from datetime import datetime, timedelta
db = Db("")
def calculate_payment(id):
select = f"SELECT * FROM TASK_COMPLETED WHERE USER_ID = (%s) AND COLLECT NOT IN ( 0 )"
completed_tasks = db.execute(select, (id,), 1)
select_all_tasks = f"SELECT * FROM TASK_COMPLETED ... | true | true |
1c1e5ae78adad650ec6808b1fa0c19fc1649a61d | 432 | py | Python | src/python/pants/backend/python/subsystems/isort.py | GoingTharn/pants | d3f2005dcae0745f3e3bf525fc46e7d28f04f073 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/subsystems/isort.py | GoingTharn/pants | d3f2005dcae0745f3e3bf525fc46e7d28f04f073 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/subsystems/isort.py | GoingTharn/pants | d3f2005dcae0745f3e3bf525fc46e7d28f04f073 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.binaries.binary_tool import Script
class Isort(Script):
options_scope = 'i... | 25.411765 | 82 | 0.759259 |
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.binaries.binary_tool import Script
class Isort(Script):
options_scope = 'isort'
default_version = '4.3.4'
suffix = '.pex'
replaces_scope = 'fmt.isort'
replaces_name = 'version'
| true | true |
1c1e5b36934035c3cc1ec24e09ab649d58715061 | 4,412 | py | Python | tester.py | zigaLuksic/glitch-doctor | 85ae7bfec15e0a0c564f31669c3d9f04a76aa159 | [
"MIT"
] | null | null | null | tester.py | zigaLuksic/glitch-doctor | 85ae7bfec15e0a0c564f31669c3d9f04a76aa159 | [
"MIT"
] | null | null | null | tester.py | zigaLuksic/glitch-doctor | 85ae7bfec15e0a0c564f31669c3d9f04a76aa159 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import time
from scipy.optimize import rosen, differential_evolution
from metamodel import Metamodel
from sklearn import ensemble, tree
from test_models.repressilator import repressilator, repressilator_bounds
# --------------------------------------------------------... | 33.172932 | 88 | 0.640979 | import numpy as np
import matplotlib.pyplot as plt
import time
from scipy.optimize import rosen, differential_evolution
from metamodel import Metamodel
from sklearn import ensemble, tree
from test_models.repressilator import repressilator, repressilator_bounds
metamodel_kwargs = {"random_seed": 28537}
model_kwargs... | true | true |
1c1e5cd527c3b2172ea1536f565bd120eabdab9b | 127 | py | Python | tests/unit/test_module/__init__.py | allrod5/vardef | 5e2db78e496345e7b79cceba7e08ee123b2366d1 | [
"MIT"
] | 1 | 2020-12-04T18:20:28.000Z | 2020-12-04T18:20:28.000Z | tests/unit/test_module/__init__.py | allrod5/vardef | 5e2db78e496345e7b79cceba7e08ee123b2366d1 | [
"MIT"
] | null | null | null | tests/unit/test_module/__init__.py | allrod5/vardef | 5e2db78e496345e7b79cceba7e08ee123b2366d1 | [
"MIT"
] | null | null | null | from vardef import vardef
class Bar:
counter = 0
@vardef
def bar() -> int:
Bar.counter += 1
return Bar.counter
| 10.583333 | 25 | 0.629921 | from vardef import vardef
class Bar:
counter = 0
@vardef
def bar() -> int:
Bar.counter += 1
return Bar.counter
| true | true |
1c1e5d36ae30841719a250ee0a96e0895fba7347 | 2,849 | py | Python | utils/stacking.py | matheushent/clfs-models | e2f95064cc036289c203080e75718964873a5d8a | [
"MIT"
] | null | null | null | utils/stacking.py | matheushent/clfs-models | e2f95064cc036289c203080e75718964873a5d8a | [
"MIT"
] | null | null | null | utils/stacking.py | matheushent/clfs-models | e2f95064cc036289c203080e75718964873a5d8a | [
"MIT"
] | null | null | null | """Core module for stacking related operations"""
from sklearn.base import BaseEstimator, TransformerMixin, RegressorMixin, clone
from sklearn.model_selection import KFold
import numpy as np
import pickle
import os
class StackingAveragedModels(BaseEstimator, RegressorMixin, TransformerMixin):
def __init__(self, ... | 40.7 | 122 | 0.649702 | from sklearn.base import BaseEstimator, TransformerMixin, RegressorMixin, clone
from sklearn.model_selection import KFold
import numpy as np
import pickle
import os
class StackingAveragedModels(BaseEstimator, RegressorMixin, TransformerMixin):
def __init__(self, base_models, meta_model, n_folds=5):
self... | true | true |
1c1e5f61eb7615402b5c370f421e423b5b0e6968 | 1,938 | py | Python | Auto_diff/tests/test_jacobian.py | AutoDiff-Dream-Team/cs107-FinalProject | 4c3b0f6945acfe6fd3fe2757858538ec3cceb819 | [
"MIT"
] | null | null | null | Auto_diff/tests/test_jacobian.py | AutoDiff-Dream-Team/cs107-FinalProject | 4c3b0f6945acfe6fd3fe2757858538ec3cceb819 | [
"MIT"
] | null | null | null | Auto_diff/tests/test_jacobian.py | AutoDiff-Dream-Team/cs107-FinalProject | 4c3b0f6945acfe6fd3fe2757858538ec3cceb819 | [
"MIT"
] | null | null | null | import numpy as np
from Auto_diff import FD, Jacobian
def test_function_jacobian():
x = Jacobian([1, 3, 4])
fun = np.sin(3*x[0] + 2*x[1] - x[2])
assert isinstance(fun[0], FD), AssertionError('Not an instance of AD.')
assert isinstance(fun[0].val, int) or isinstance(fun[0].val, float), AssertionError('V... | 62.516129 | 124 | 0.711558 | import numpy as np
from Auto_diff import FD, Jacobian
def test_function_jacobian():
x = Jacobian([1, 3, 4])
fun = np.sin(3*x[0] + 2*x[1] - x[2])
assert isinstance(fun[0], FD), AssertionError('Not an instance of AD.')
assert isinstance(fun[0].val, int) or isinstance(fun[0].val, float), AssertionError('V... | true | true |
1c1e603f2d9ef9fb3a76c6f6e044afa4c9fc94f4 | 2,975 | py | Python | user_accounts/serializers.py | tralahtek/django-user-accounts | c0f1666d7b0d7acebcba8c941baaf2a46b61cdff | [
"MIT"
] | null | null | null | user_accounts/serializers.py | tralahtek/django-user-accounts | c0f1666d7b0d7acebcba8c941baaf2a46b61cdff | [
"MIT"
] | 1 | 2020-05-11T22:47:41.000Z | 2020-05-11T22:47:41.000Z | user_accounts/serializers.py | tralahtek/django-user-accounts | c0f1666d7b0d7acebcba8c941baaf2a46b61cdff | [
"MIT"
] | null | null | null | from rest_framework import serializers
from user_accounts.models import User, Account, Transaction
class AccRelatedSerializer(serializers.RelatedField):
def to_native(self, acc):
return {
'balance': acc.balance,
'created_at': acc.created_at,
'updated_at': acc.modified_a... | 34.195402 | 84 | 0.575126 | from rest_framework import serializers
from user_accounts.models import User, Account, Transaction
class AccRelatedSerializer(serializers.RelatedField):
def to_native(self, acc):
return {
'balance': acc.balance,
'created_at': acc.created_at,
'updated_at': acc.modified_a... | true | true |
1c1e605d94f3c80a17879d176bb864af377526ae | 3,378 | py | Python | ActuTopic/ActuTopic/settings.py | emma-tarfi/ActuTopic-Project-Django | 4180e042eec86607fe8758f9315fef91832cab47 | [
"MIT"
] | null | null | null | ActuTopic/ActuTopic/settings.py | emma-tarfi/ActuTopic-Project-Django | 4180e042eec86607fe8758f9315fef91832cab47 | [
"MIT"
] | null | null | null | ActuTopic/ActuTopic/settings.py | emma-tarfi/ActuTopic-Project-Django | 4180e042eec86607fe8758f9315fef91832cab47 | [
"MIT"
] | null | null | null | """
Django settings for ActuTopic project.
Generated by 'django-admin startproject' using Django 2.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
... | 25.78626 | 91 | 0.694198 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'puqp5)tn&o)h4k53xny=he2&_g-dm^v@59k)x8h9)njem*q5_v'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contentt... | true | true |
1c1e61266e98d2b21e6d33870c4fc695e3d2e535 | 7,504 | py | Python | tests/fixtures/minecraftversions.py | minedoscrazy/versions-getter | d65c2e992419057109358b995d083e5bac0adf19 | [
"MIT"
] | 4 | 2021-07-04T20:15:05.000Z | 2021-07-11T00:16:46.000Z | tests/fixtures/minecraftversions.py | minedoscrazy/versions-scraper | d65c2e992419057109358b995d083e5bac0adf19 | [
"MIT"
] | 1 | 2021-07-04T23:11:29.000Z | 2021-07-05T19:12:11.000Z | tests/fixtures/minecraftversions.py | minedoscrazy/versions-scraper | d65c2e992419057109358b995d083e5bac0adf19 | [
"MIT"
] | null | null | null | from os.path import dirname as _dirname
def _get_page_content() -> str:
current_path = _dirname(__file__)
with open(f'{current_path}/pages/minecraftversions.html', 'r') as file:
return file.read()
PAGE = _get_page_content()
KEYS = [
'Stable Releases',
'Snapshot Preview',
'Beta',
... | 14.771654 | 75 | 0.41178 | from os.path import dirname as _dirname
def _get_page_content() -> str:
current_path = _dirname(__file__)
with open(f'{current_path}/pages/minecraftversions.html', 'r') as file:
return file.read()
PAGE = _get_page_content()
KEYS = [
'Stable Releases',
'Snapshot Preview',
'Beta',
... | true | true |
1c1e615baf86b5e92fe4d8876df6fc80b2309d5c | 20,667 | py | Python | raxmlOutputWindows/matplotlibCustomBackend/customFormlayout.py | chilleo/ALPHA | 61ac17a08eb4eb778cec9236f4792c97969311a2 | [
"MIT"
] | 11 | 2017-09-18T20:32:04.000Z | 2020-08-27T03:38:03.000Z | raxmlOutputWindows/matplotlibCustomBackend/customFormlayout.py | chilleo/ALPHA | 61ac17a08eb4eb778cec9236f4792c97969311a2 | [
"MIT"
] | 3 | 2017-09-30T00:13:47.000Z | 2019-06-18T23:24:55.000Z | raxmlOutputWindows/matplotlibCustomBackend/customFormlayout.py | chilleo/ALPHA | 61ac17a08eb4eb778cec9236f4792c97969311a2 | [
"MIT"
] | 5 | 2017-09-28T01:17:15.000Z | 2019-05-11T08:56:29.000Z | # -*- coding: utf-8 -*-
"""
formlayout
==========
Module creating Qt form dialogs/layouts to edit various type of parameters
formlayout License Agreement (MIT License)
------------------------------------------
Copyright (c) 2009 Pierre Raybaut
Permission is hereby granted, free of charge, to any person
obtaining ... | 35.694301 | 108 | 0.58712 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
__version__ = '1.0.10'
__license__ = __doc__
DEBUG = False
import copy
import datetime
import warnings
import six
from matplotlib import colors as mcolors
from matplotlib.backends.qt_compat import Qt... | true | true |
1c1e622d7122f065159c8052230aa3bd1584c17f | 23,102 | py | Python | zhcal.py | 910JQK/zhcal | 97f8af8517e2fd45be5238eb7fc4b2915057e9a9 | [
"MIT"
] | 15 | 2015-10-05T15:15:30.000Z | 2020-02-07T15:51:36.000Z | zhcal.py | 910JQK/zhcal | 97f8af8517e2fd45be5238eb7fc4b2915057e9a9 | [
"MIT"
] | null | null | null | zhcal.py | 910JQK/zhcal | 97f8af8517e2fd45be5238eb7fc4b2915057e9a9 | [
"MIT"
] | 4 | 2015-10-05T23:40:36.000Z | 2020-01-19T06:13:41.000Z | #!/usr/bin/env python3
import argparse
import datetime
from calendar import Calendar
# 每年元旦的農曆日期 (1900-2049)
# 8 位整數,高 2 位表示月,低 6 位表示日
# 月份: 0: 冬月, 1: 臘月, 2: 閏冬月
LUNAR_DATE_OF_INITIAL_DAYS = [0x41, 0xb, 0x16, 0x43, 0xe, 0x1a, 0x47, 0x11, 0x1c, 0x4a, 0x14, 0x41, 0xd, 0x18, 0x46, 0x10, 0x1a, 0x48, 0x13, 0x1e, 0xb, 0x... | 32.815341 | 1,678 | 0.595143 |
import argparse
import datetime
from calendar import Calendar
LUNAR_DATE_OF_INITIAL_DAYS = [0x41, 0xb, 0x16, 0x43, 0xe, 0x1a, 0x47, 0x11, 0x1c, 0x4a, 0x14, 0x41, 0xd, 0x18, 0x46, 0x10, 0x1a, 0x48, 0x13, 0x1e, 0xb, 0x17, 0x44, 0xf, 0x19, 0x47, 0x11, 0x1c, 0x49, 0x15, 0x42, 0xd, 0x18, 0x46, 0x10, 0x1a, 0x47, 0x13... | true | true |
1c1e632cae6fb2338caa36a60b66542eaaca504f | 157 | py | Python | Number Theory/check_coprimes.py | Dheer08/Algorithms | 6731a5896ab338b6123280275fab5f36bdd52b4d | [
"MIT"
] | null | null | null | Number Theory/check_coprimes.py | Dheer08/Algorithms | 6731a5896ab338b6123280275fab5f36bdd52b4d | [
"MIT"
] | null | null | null | Number Theory/check_coprimes.py | Dheer08/Algorithms | 6731a5896ab338b6123280275fab5f36bdd52b4d | [
"MIT"
] | null | null | null | import math
a = 2
b = 4
gcd = math.gcd(a,b)
if gcd == 1 :
print(a,",",b,"are co-primes")
else :
print("gcd : ",gcd)
print(a,",",b,"are not co-primes") | 14.272727 | 35 | 0.547771 | import math
a = 2
b = 4
gcd = math.gcd(a,b)
if gcd == 1 :
print(a,",",b,"are co-primes")
else :
print("gcd : ",gcd)
print(a,",",b,"are not co-primes") | true | true |
1c1e6350cf43847f2d10b11f0d1ab11d5b54ccac | 513 | py | Python | MINI PROJECTS/Hostname_IPaddress.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | MINI PROJECTS/Hostname_IPaddress.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | MINI PROJECTS/Hostname_IPaddress.py | siddharth-143/Python | 293f4643a3a13e3b82d23fd8922db54dbb0f12bc | [
"MIT"
] | null | null | null | """
Python program to check hostname and ipaddress.
"""
import socket
def get_hostname_IP():
hostname = input("Please enter a website addresss(URL) : ")
try:
print(f"Hostname : {hostname}")
print(f"IP : {socket.gethostbyname(hostname)}")
except socket.gaierror as error:
print(f... | 23.318182 | 63 | 0.653021 |
import socket
def get_hostname_IP():
hostname = input("Please enter a website addresss(URL) : ")
try:
print(f"Hostname : {hostname}")
print(f"IP : {socket.gethostbyname(hostname)}")
except socket.gaierror as error:
print(f"Invalid Hostname, error raised is {error}")
get_hostname_I... | true | true |
1c1e63fd7946ac870d365114d1a2f1a6499504f6 | 2,047 | py | Python | generate_embed.py | ibivu/protein-glue | 47f68b4789c6750dfb9bf6d6ae382a9061514bfd | [
"CC0-1.0"
] | 4 | 2021-12-27T01:42:50.000Z | 2022-02-11T13:47:53.000Z | generate_embed.py | ibivu/protein-glue | 47f68b4789c6750dfb9bf6d6ae382a9061514bfd | [
"CC0-1.0"
] | null | null | null | generate_embed.py | ibivu/protein-glue | 47f68b4789c6750dfb9bf6d6ae382a9061514bfd | [
"CC0-1.0"
] | null | null | null | import tensorflow as tf
import numpy as np
import click
from dataset.fasta import read_fasta, to_seq_array
from model import BERTTransformer
predict_step_signature = [
tf.TensorSpec(shape=(None, None), dtype=tf.int32),
]
@click.command()
@click.argument('checkpoint_dir')
@click.argument('input_fasta')
@click.arg... | 30.552239 | 132 | 0.682951 | import tensorflow as tf
import numpy as np
import click
from dataset.fasta import read_fasta, to_seq_array
from model import BERTTransformer
predict_step_signature = [
tf.TensorSpec(shape=(None, None), dtype=tf.int32),
]
@click.command()
@click.argument('checkpoint_dir')
@click.argument('input_fasta')
@click.arg... | true | true |
1c1e6423c6c9f42c52263a4bd684ae337d994a05 | 972 | py | Python | preprocess/main.py | undeadyequ/protest-detection-violence-estimation | 0781e83d7b37353be1cb25ca2a4917de416a7891 | [
"MIT"
] | null | null | null | preprocess/main.py | undeadyequ/protest-detection-violence-estimation | 0781e83d7b37353be1cb25ca2a4917de416a7891 | [
"MIT"
] | null | null | null | preprocess/main.py | undeadyequ/protest-detection-violence-estimation | 0781e83d7b37353be1cb25ca2a4917de416a7891 | [
"MIT"
] | null | null | null | from data_prepare import prepar_data, separte_train_test
from data_preprocess import clean_fine_grain
def main():
# clean data
dir_f = '/home/Data/image_data/Presidential'
new_dir = "/home/Data/image_data/Presidential_clean"
#clean_fine_grain(dir_f, new_dir)
# Prepare transcription and label of ea... | 34.714286 | 80 | 0.688272 | from data_prepare import prepar_data, separte_train_test
from data_preprocess import clean_fine_grain
def main():
dir_f = '/home/Data/image_data/Presidential'
new_dir = "/home/Data/image_data/Presidential_clean"
fine_grain_dir = "/home/Data/image_data/Presidential_clean"
label2num = {'B... | true | true |
1c1e643a4791361a9a766b841e93e4fcaddfe9d1 | 966 | py | Python | orders/migrations/0001_initial.py | sumangaire52/dammideal | 83c0a6e962b51405016ed83c4597ebcd9dee0d04 | [
"Apache-2.0"
] | null | null | null | orders/migrations/0001_initial.py | sumangaire52/dammideal | 83c0a6e962b51405016ed83c4597ebcd9dee0d04 | [
"Apache-2.0"
] | 7 | 2020-06-05T17:55:00.000Z | 2022-01-13T00:44:26.000Z | orders/migrations/0001_initial.py | sumangaire52/dammideal | 83c0a6e962b51405016ed83c4597ebcd9dee0d04 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.1 on 2018-02-08 19:30
from django.db import migrations, models
import phonenumber_field.modelfields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Order',
fields=[
... | 35.777778 | 148 | 0.63147 |
from django.db import migrations, models
import phonenumber_field.modelfields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Order',
fields=[
('id', models.AutoField(auto_created... | true | true |
1c1e64d3de31a080a6242876a864ce81f5077e02 | 76,936 | py | Python | kubernetes_asyncio/client/api/networking_v1_api.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/api/networking_v1_api.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/api/networking_v1_api.py | PidgeyBE/kubernetes_asyncio | 14d15dc309890253c26b6274a022e84441e05217 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.13.5
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# p... | 69.062837 | 1,390 | 0.699023 |
from __future__ import absolute_import
import re
import six
from kubernetes_asyncio.client.api_client import ApiClient
class NetworkingV1Api(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def cr... | true | true |
1c1e653776bad0d43a3fc7817b5ab5fb7ff5260b | 4,130 | py | Python | colour/recovery/dataset/smits1999.py | sobotka/colour | aa3fe95fba83ffc0f3ce1eb6aca85e6d8f3bde51 | [
"Cube",
"BSD-3-Clause"
] | 2 | 2020-05-03T20:15:42.000Z | 2021-04-09T18:19:06.000Z | colour/recovery/dataset/smits1999.py | sobotka/colour | aa3fe95fba83ffc0f3ce1eb6aca85e6d8f3bde51 | [
"Cube",
"BSD-3-Clause"
] | null | null | null | colour/recovery/dataset/smits1999.py | sobotka/colour | aa3fe95fba83ffc0f3ce1eb6aca85e6d8f3bde51 | [
"Cube",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Smits (1999) - Reflectance Recovery Dataset
===========================================
Defines the dataset for reflectance recovery using *Smits (1999)* method.
References
----------
- :cite:`Smits1999a` : Smits, B. (1999). An RGB-to-Spectrum Conversion for
Reflectances. Journal of ... | 25.652174 | 78 | 0.556174 |
from __future__ import division, unicode_literals
from colour.algebra import LinearInterpolator
from colour.colorimetry.spectrum import SpectralDistribution
from colour.utilities import CaseInsensitiveMapping
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013-2019 - Colour Developers'
__license__ ... | true | true |
1c1e65af483243218d22ad9b3559bc7ce8813e1b | 11,708 | py | Python | python_modules/libraries/lakehouse/lakehouse/house.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-07-03T09:05:58.000Z | 2021-07-03T09:05:58.000Z | python_modules/libraries/lakehouse/lakehouse/house.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/lakehouse/lakehouse/house.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-11-30T21:40:46.000Z | 2021-11-30T21:40:46.000Z | from functools import wraps
from typing import List, Optional
from dagster import (
AssetMaterialization,
CompositeSolidDefinition,
DependencyDefinition,
InputDefinition,
Nothing,
Output,
OutputDefinition,
PipelineDefinition,
SolidDefinition,
check,
)
from .asset import Asset
f... | 40.372414 | 100 | 0.615647 | from functools import wraps
from typing import List, Optional
from dagster import (
AssetMaterialization,
CompositeSolidDefinition,
DependencyDefinition,
InputDefinition,
Nothing,
Output,
OutputDefinition,
PipelineDefinition,
SolidDefinition,
check,
)
from .asset import Asset
f... | true | true |
1c1e65e68756ab3eac753a69318620bb14416f2b | 773 | py | Python | SRC/02_class/HelloWorld/HelloApp/migrations/0001_initial.py | archeranimesh/django-programink | ab5d7293e17c16f9cf391e9ca3b067340440d516 | [
"MIT"
] | null | null | null | SRC/02_class/HelloWorld/HelloApp/migrations/0001_initial.py | archeranimesh/django-programink | ab5d7293e17c16f9cf391e9ca3b067340440d516 | [
"MIT"
] | null | null | null | SRC/02_class/HelloWorld/HelloApp/migrations/0001_initial.py | archeranimesh/django-programink | ab5d7293e17c16f9cf391e9ca3b067340440d516 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-06-27 13:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='HelloCustomer',
fields=[
('id', models.AutoFi... | 28.62963 | 114 | 0.554981 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='HelloCustomer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, seri... | true | true |
1c1e671619193548417b64973fff76a37e128a27 | 358 | py | Python | PersonalAss/SearchGoogle.py | Sowik/Personal-Assistant | e82b822681ecd18ae27387b6b99885c32d2f6357 | [
"MIT"
] | null | null | null | PersonalAss/SearchGoogle.py | Sowik/Personal-Assistant | e82b822681ecd18ae27387b6b99885c32d2f6357 | [
"MIT"
] | null | null | null | PersonalAss/SearchGoogle.py | Sowik/Personal-Assistant | e82b822681ecd18ae27387b6b99885c32d2f6357 | [
"MIT"
] | null | null | null | import webbrowser
from PersonalAss import Assistant
def searchGoogle():
Assistant.speak('Opening Google...')
Assistant.query = Assistant.query.replace("search google for ", "")
Assistant.query = Assistant.query.replace(" ", "+")
webbrowser.open("google.com/search?q=" + Assistant.query) #otvarqme... | 39.777778 | 108 | 0.712291 | import webbrowser
from PersonalAss import Assistant
def searchGoogle():
Assistant.speak('Opening Google...')
Assistant.query = Assistant.query.replace("search google for ", "")
Assistant.query = Assistant.query.replace(" ", "+")
webbrowser.open("google.com/search?q=" + Assistant.query)
| true | true |
1c1e67acdfc8e43780d66d049e1d38f0ca802af3 | 1,000 | py | Python | isi_sdk_8_2_2/test/test_storagepool_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_2_2/test/test_storagepool_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_2_2/test/test_storagepool_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_2
from i... | 24.390244 | 112 | 0.734 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_2_2
from isi_sdk_8_2_2.models.storagepool_settings_settings import StoragepoolSettingsSettings
from isi_sdk_8_2_2.rest import ApiException
class TestStoragepoolSettingsSettings(unittest.TestCase):
def setUp(self):
pass
d... | true | true |
1c1e67f2f3e1b84feb8fb2aa3b258f37862163f1 | 754 | py | Python | company/views.py | jiun0507/minestock | b333298575cae1c426cc4450e85e9e576458b74a | [
"Unlicense"
] | null | null | null | company/views.py | jiun0507/minestock | b333298575cae1c426cc4450e85e9e576458b74a | [
"Unlicense"
] | null | null | null | company/views.py | jiun0507/minestock | b333298575cae1c426cc4450e85e9e576458b74a | [
"Unlicense"
] | 1 | 2021-10-15T20:10:39.000Z | 2021-10-15T20:10:39.000Z | from company.use_case.get_company_profile import CompanyProfileUseCase
from django.shortcuts import render
from django.views import View
from Interface import iex_api
from keys import Keys
from django.utils.safestring import mark_safe
import json
class CompanyView(View):
def __init__(self):
self.company_p... | 32.782609 | 74 | 0.71618 | from company.use_case.get_company_profile import CompanyProfileUseCase
from django.shortcuts import render
from django.views import View
from Interface import iex_api
from keys import Keys
from django.utils.safestring import mark_safe
import json
class CompanyView(View):
def __init__(self):
self.company_p... | true | true |
1c1e689183d2ce979244ad1a226d1b603ba0e003 | 2,752 | py | Python | hypergraph/bandits.py | sflinter/hypergraph | c3108ee51361d2e4b8ddc7eced1953f1548ce8d8 | [
"Apache-2.0"
] | 1 | 2020-12-17T11:17:56.000Z | 2020-12-17T11:17:56.000Z | hypergraph/bandits.py | sflinter/hypergraph | c3108ee51361d2e4b8ddc7eced1953f1548ce8d8 | [
"Apache-2.0"
] | null | null | null | hypergraph/bandits.py | sflinter/hypergraph | c3108ee51361d2e4b8ddc7eced1953f1548ce8d8 | [
"Apache-2.0"
] | null | null | null | # Multi-armed bandit-based algorithms
import numpy as np
from .genetic import GeneticOperators
class HyperBand:
def __init__(self, config_ranges, loss, max_resources_per_conf, eta=3):
"""
Init the hyper band algorithm
:param config_ranges: Config ranges eg taken from graph.get_hpopt_confi... | 45.114754 | 124 | 0.62609 |
import numpy as np
from .genetic import GeneticOperators
class HyperBand:
def __init__(self, config_ranges, loss, max_resources_per_conf, eta=3):
self.config_ranges = dict(config_ranges)
self.loss = loss
self.max_resources_per_conf = max_resources_per_conf
self.eta = eta
def... | true | true |
1c1e690576b0ff7bd880c1bb03c8bffb2bff6a91 | 47,064 | py | Python | reveal/reveal.py | jasperlinthorst/reveal | 521f350260ae81eaf357c311a50b42e0fb774f64 | [
"MIT"
] | 46 | 2015-07-18T15:32:23.000Z | 2022-01-17T15:15:31.000Z | reveal/reveal.py | jasperlinthorst/reveal | 521f350260ae81eaf357c311a50b42e0fb774f64 | [
"MIT"
] | 31 | 2015-10-15T15:25:12.000Z | 2020-08-13T15:15:09.000Z | reveal/reveal.py | jasperlinthorst/reveal | 521f350260ae81eaf357c311a50b42e0fb774f64 | [
"MIT"
] | 4 | 2016-09-03T15:48:58.000Z | 2020-04-22T11:46:35.000Z | #!/usr/bin/env python
from intervaltree import Interval, IntervalTree
import networkx as nx
import argparse
import os
import sys
import time
#reveal imports
import schemes
import transform
import transformold
import plot
import utils
import merge
import subgraph
import comp
import extract
import convert
import rem
imp... | 119.451777 | 376 | 0.750042 |
from intervaltree import Interval, IntervalTree
import networkx as nx
import argparse
import os
import sys
import time
import schemes
import transform
import transformold
import plot
import utils
import merge
import subgraph
import comp
import extract
import convert
import rem
import refine
import bubbles
import mat... | true | true |
1c1e69935306ec1cbee3d8857c2bd78290e9efeb | 28,550 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_express_route_ports_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.309154 | 203 | 0.671629 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
1c1e69bf169047f1f15b065e8c76f04b6ac4c75b | 1,027 | py | Python | virtual/lib/python3.6/site-packages/rest_framework/utils/json.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 17,395 | 2017-03-31T21:13:13.000Z | 2022-03-31T21:33:13.000Z | virtual/lib/python3.6/site-packages/rest_framework/utils/json.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 2,983 | 2017-03-31T14:43:26.000Z | 2022-03-31T20:34:23.000Z | virtual/lib/python3.6/site-packages/rest_framework/utils/json.py | Ruterana/clone_instagram | a068587ef1d1a93ec8d1c08086bf11c0fb274b83 | [
"MIT"
] | 5,159 | 2017-03-31T15:06:32.000Z | 2022-03-31T03:25:17.000Z | """
Wrapper for the builtin json module that ensures compliance with the JSON spec.
REST framework should always import this wrapper module in order to maintain
spec-compliant encoding/decoding. Support for non-standard features should be
handled by users at the renderer and parser layer.
"""
import functools
import j... | 27.026316 | 84 | 0.734177 | import functools
import json
def strict_constant(o):
raise ValueError('Out of range float values are not JSON compliant: ' + repr(o))
@functools.wraps(json.dump)
def dump(*args, **kwargs):
kwargs.setdefault('allow_nan', False)
return json.dump(*args, **kwargs)
@functools.wraps(json.dumps)
def dumps(... | true | true |
1c1e6aa904110d8616ce0df89014efb4bb71cb1b | 8,768 | py | Python | vsm/extensions/corpusbuilders/util.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 31 | 2015-01-30T20:09:48.000Z | 2021-08-13T12:57:49.000Z | vsm/extensions/corpusbuilders/util.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 80 | 2015-01-30T19:08:40.000Z | 2019-11-02T20:15:56.000Z | vsm/extensions/corpusbuilders/util.py | inpho/vsm | d5fc930ccc95f275e10e151c8f05db2c05aba01f | [
"MIT"
] | 10 | 2015-09-18T01:52:23.000Z | 2019-07-14T08:22:06.000Z | from builtins import str
from builtins import chr
from builtins import range
from builtins import object
from past.builtins import basestring
import re
import string
from chardet.universaldetector import UniversalDetector
import numpy as np
__all__ = ['strip_punc', 'rem_num', 'rehyph',
'apply_stoplist', 'f... | 28.747541 | 128 | 0.654881 | from builtins import str
from builtins import chr
from builtins import range
from builtins import object
from past.builtins import basestring
import re
import string
from chardet.universaldetector import UniversalDetector
import numpy as np
__all__ = ['strip_punc', 'rem_num', 'rehyph',
'apply_stoplist', 'f... | true | true |
1c1e6af804054a06b0d5003865a13ece7a37bdcc | 2,970 | py | Python | pub/settings.py | DASTUDIO/MyVHost | b9eda56a67c2df9236b7866087bc7f465542f951 | [
"MIT"
] | 2 | 2021-07-27T10:38:57.000Z | 2021-10-10T20:42:56.000Z | pub/settings.py | DASTUDIO/MyVHost | b9eda56a67c2df9236b7866087bc7f465542f951 | [
"MIT"
] | null | null | null | pub/settings.py | DASTUDIO/MyVHost | b9eda56a67c2df9236b7866087bc7f465542f951 | [
"MIT"
] | null | null | null | # coding=utf-8
import os
RELEASE = False
THEME = 'whiteconsole' # whiteconsole / superadmin
DOMAIN = ['lab.zhangxinhao.com','localhost','127.0.0.1']
# 用于验证域名是否解析过来了
IP = ['111.231.19.116']
# 绑定用户做的解析
DOMAIN_VERIFY_IP = '47.254.41.44'
CACHE_SIZE = 1024
BASE_DIR = os.path.dirname(o... | 19.932886 | 83 | 0.76936 |
import os
RELEASE = False
THEME = 'whiteconsole'
DOMAIN = ['lab.zhangxinhao.com','localhost','127.0.0.1']
IP = ['111.231.19.116']
DOMAIN_VERIFY_IP = '47.254.41.44'
CACHE_SIZE = 1024
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(BASE_DIR,'st... | true | true |
1c1e6caef19ba533884da8a21cdd60b0ecf6bb0d | 1,623 | py | Python | src/VulnerableScanner/JenkinsUnauthScript.py | b0bac/B0b-cExploit | 96cb395423410d4cd18ca0f0ca2f118ecc6a817e | [
"Apache-2.0"
] | 10 | 2022-02-14T09:02:39.000Z | 2022-03-17T02:42:24.000Z | src/VulnerableScanner/JenkinsUnauthScript.py | b0bac/B0b-cExploit | 96cb395423410d4cd18ca0f0ca2f118ecc6a817e | [
"Apache-2.0"
] | null | null | null | src/VulnerableScanner/JenkinsUnauthScript.py | b0bac/B0b-cExploit | 96cb395423410d4cd18ca0f0ca2f118ecc6a817e | [
"Apache-2.0"
] | 5 | 2022-02-14T10:26:05.000Z | 2022-03-24T13:50:53.000Z | from CoreUtils.VulnerableScanningEngine import VulnerableScannerBaseClass, ScannerRegister
class JenkinsUnauthScriptScanner(VulnerableScannerBaseClass):
def __init__(self, target):
super().__init__(target)
self.target_to_scan = self.target_tuple()
def scan(self):
if self.size == 1:
... | 40.575 | 104 | 0.641405 | from CoreUtils.VulnerableScanningEngine import VulnerableScannerBaseClass, ScannerRegister
class JenkinsUnauthScriptScanner(VulnerableScannerBaseClass):
def __init__(self, target):
super().__init__(target)
self.target_to_scan = self.target_tuple()
def scan(self):
if self.size == 1:
... | true | true |
1c1e6ce6da779f6fa71ded649d58aa5d66383024 | 673 | py | Python | Day-093/string_cleanup.py | arvimal/100DaysofCode-Python | 01e59f45b4dc06a3be9e9900456a6bd439752911 | [
"MIT"
] | 1 | 2020-06-15T05:59:01.000Z | 2020-06-15T05:59:01.000Z | Day-093/string_cleanup.py | arvimal/100DaysofCode-Python | 01e59f45b4dc06a3be9e9900456a6bd439752911 | [
"MIT"
] | null | null | null | Day-093/string_cleanup.py | arvimal/100DaysofCode-Python | 01e59f45b4dc06a3be9e9900456a6bd439752911 | [
"MIT"
] | 7 | 2020-01-24T23:03:58.000Z | 2021-05-31T01:00:27.000Z | #!/usr/bin/env python3
"""
Cleanup the given list of strings, and print each string in
its own line
"""
love_maybe_lines = [
"Always ",
" in the middle of our bloodiest battles ",
"you lay down your arms",
" like flowering mines ",
"\n",
" to conquer me home. ",
]
lo... | 24.925926 | 61 | 0.652303 |
love_maybe_lines = [
"Always ",
" in the middle of our bloodiest battles ",
"you lay down your arms",
" like flowering mines ",
"\n",
" to conquer me home. ",
]
love_maybe_lines_stripped = []
for line in love_maybe_lines:
new_line = line.strip()
... | true | true |
1c1e6d0edc59542b9f271492caa014a42765be23 | 2,679 | py | Python | parl/remote/tests/reset_job_test_alone.py | lp2333/PARL | e4bde1f5b7e69c5f8d3ee3a90a647dfe12204bd3 | [
"ECL-2.0",
"Apache-2.0"
] | 3,172 | 2018-05-22T02:02:29.000Z | 2022-03-31T09:14:56.000Z | parl/remote/tests/reset_job_test_alone.py | BKBK00/PARL | f508bc6085420431b504441c7ff129e64826603e | [
"Apache-2.0"
] | 422 | 2018-05-17T16:58:45.000Z | 2022-03-31T02:03:25.000Z | parl/remote/tests/reset_job_test_alone.py | BKBK00/PARL | f508bc6085420431b504441c7ff129e64826603e | [
"Apache-2.0"
] | 794 | 2018-05-21T18:33:19.000Z | 2022-03-30T13:38:09.000Z | # Copyright (c) 2018 PaddlePaddle 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 app... | 29.119565 | 189 | 0.643524 |
import unittest
import parl
from parl.remote.master import Master
from parl.remote.worker import Worker
from parl.remote.client import disconnect
from parl.utils import logger, _IS_WINDOWS
import os
import threading
import time
import subprocess
from parl.utils import get_free_tcp_port
@parl.remote_class... | true | true |
1c1e6dfce48c33632c997617463b5f01c9976378 | 12,175 | py | Python | AER/Torch_Runners/Run_Regression.py | formiel/NeurIPS2021 | a2a29a1904779c3ffd1a002fd057bf90b31a234d | [
"MIT"
] | 48 | 2021-03-25T14:00:04.000Z | 2022-03-27T17:00:00.000Z | AER/Torch_Runners/Run_Regression.py | formiel/NeurIPS2021 | a2a29a1904779c3ffd1a002fd057bf90b31a234d | [
"MIT"
] | 2 | 2021-04-16T13:21:44.000Z | 2021-06-16T15:23:09.000Z | AER/Torch_Runners/Run_Regression.py | formiel/NeurIPS2021 | a2a29a1904779c3ffd1a002fd057bf90b31a234d | [
"MIT"
] | 8 | 2021-09-09T14:49:14.000Z | 2022-03-03T15:53:09.000Z | from Experiment import Experiment
import json
import argparse
from modelWrapper import ModelWrapper
from DataReader import DataReader
import pandas as pd
import numpy as np
# import torch
from torch.utils.data import DataLoader
import os, sys
from Metrics import *
from funcs import csvReader, printProgressBar, smooth
... | 41.131757 | 177 | 0.721807 | from Experiment import Experiment
import json
import argparse
from modelWrapper import ModelWrapper
from DataReader import DataReader
import pandas as pd
import numpy as np
from torch.utils.data import DataLoader
import os, sys
from Metrics import *
from funcs import csvReader, printProgressBar, smooth
def main(json... | true | true |
1c1e6ea376cd2771f9e86e52b715fca94c793044 | 2,587 | py | Python | lib/core/combiner.py | d4l-data4life/BBNOrchestra-for-VQAmed2021 | b083c0c9c2be73419ca43536bf185fff379cf98c | [
"MIT"
] | 2 | 2021-05-31T08:45:42.000Z | 2021-09-08T07:46:34.000Z | lib/core/combiner.py | d4l-data4life/BBNOrchestra-for-VQAmed2021 | b083c0c9c2be73419ca43536bf185fff379cf98c | [
"MIT"
] | null | null | null | lib/core/combiner.py | d4l-data4life/BBNOrchestra-for-VQAmed2021 | b083c0c9c2be73419ca43536bf185fff379cf98c | [
"MIT"
] | null | null | null | import numpy as np
import torch, math
from core.evaluate import accuracy
class Combiner:
def __init__(self, cfg, device):
self.cfg = cfg
self.type = cfg.TRAIN.COMBINER.TYPE
self.device = device
self.epoch_number = cfg.TRAIN.MAX_EPOCH
self.func = torch.nn.Softmax(dim=1)
... | 38.044118 | 90 | 0.592192 | import numpy as np
import torch, math
from core.evaluate import accuracy
class Combiner:
def __init__(self, cfg, device):
self.cfg = cfg
self.type = cfg.TRAIN.COMBINER.TYPE
self.device = device
self.epoch_number = cfg.TRAIN.MAX_EPOCH
self.func = torch.nn.Softmax(dim=1)
... | true | true |
1c1e6eb4d37d8d42ae8655aa278bb012ae571cf4 | 5,391 | py | Python | detectron2segment/inference.py | natashanorsker/fagprojekt | ef9a8cc2128c43d891c8a7a47e14916af2b9c602 | [
"MIT"
] | 1 | 2021-02-15T08:08:38.000Z | 2021-02-15T08:08:38.000Z | detectron2segment/inference.py | natashanorsker/fagprojekt | ef9a8cc2128c43d891c8a7a47e14916af2b9c602 | [
"MIT"
] | 3 | 2021-02-24T10:43:41.000Z | 2021-06-21T12:54:51.000Z | detectron2segment/inference.py | natashanorsker/fagprojekt | ef9a8cc2128c43d891c8a7a47e14916af2b9c602 | [
"MIT"
] | 1 | 2021-02-15T10:50:19.000Z | 2021-02-15T10:50:19.000Z | """ you cannot install detectron2 in windows, i recommend WSL on windows, should work on linux and macOS just fine though
the version used here only supports pytorch 1.7.x (i think, that what i used) you can check with. You don't need this unless you want to train it.
# print(torch.__version__, torch.cuda.is_availabl... | 46.878261 | 204 | 0.685402 | import numpy as np
import os, cv2
import warnings
warnings.filterwarnings("ignore")
import detectron2
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.utils.visualizer import Visualizer
from detectron2.data import Metada... | true | true |
1c1e6ee3eda9e8649522cba0867cd8bf81a1f49a | 4,348 | py | Python | program/uipy/modify_proto_ui.py | Addision/ProtoExcelTool | 17eaa08c08312e59c5a8f6114a121177ca65508a | [
"MIT"
] | null | null | null | program/uipy/modify_proto_ui.py | Addision/ProtoExcelTool | 17eaa08c08312e59c5a8f6114a121177ca65508a | [
"MIT"
] | null | null | null | program/uipy/modify_proto_ui.py | Addision/ProtoExcelTool | 17eaa08c08312e59c5a8f6114a121177ca65508a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '../designer/ui/modify_proto.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ModifyProtoForm(object):
def setupUi(self, Modif... | 49.409091 | 85 | 0.696412 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ModifyProtoForm(object):
def setupUi(self, ModifyProtoForm):
ModifyProtoForm.setObjectName("ModifyProtoForm")
ModifyProtoForm.resize(504, 550)
self.tEtProtoDesc = QtWidgets.QTextEdit(ModifyProtoForm)
self.tEtProtoDesc.setGe... | true | true |
1c1e6f1df77de6e01fea114a8875ffe8a04986d5 | 690 | py | Python | psana/psana/pop/Legendre.py | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 16 | 2017-11-09T17:10:56.000Z | 2022-03-09T23:03:10.000Z | psana/psana/pop/Legendre.py | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 6 | 2017-12-12T19:30:05.000Z | 2020-07-09T00:28:33.000Z | psana/psana/pop/Legendre.py | JBlaschke/lcls2 | 30523ef069e823535475d68fa283c6387bcf817b | [
"BSD-3-Clause-LBNL"
] | 25 | 2017-09-18T20:02:43.000Z | 2022-03-27T22:27:42.000Z | import numpy as np
def Legendre(l,x):
if l==0:
return np.ones(len(x))
elif l==2:
return (3*x**2-1)/2
elif l==4:
x2 = x**2
return ((35*x2-30)*x2+3)/8
elif l==6:
x2 = x**2
return (((231*x2-315)*x2+105)*x2-5)/16
elif l==8:
x2 = x**2
retu... | 27.6 | 97 | 0.504348 | import numpy as np
def Legendre(l,x):
if l==0:
return np.ones(len(x))
elif l==2:
return (3*x**2-1)/2
elif l==4:
x2 = x**2
return ((35*x2-30)*x2+3)/8
elif l==6:
x2 = x**2
return (((231*x2-315)*x2+105)*x2-5)/16
elif l==8:
x2 = x**2
retu... | true | true |
1c1e6ff662ff2f19b68c05e130dd2a6757a6add2 | 380 | py | Python | fdk_client/platform/models/UserDetail.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/UserDetail.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/UserDetail.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class UserDetail(BaseSchema):
# Catalog swagger.json
user_id = fields.Str(required=False)
username = fields.Str(required=F... | 14.615385 | 42 | 0.697368 |
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class UserDetail(BaseSchema):
user_id = fields.Str(required=False)
username = fields.Str(required=False)
full_name = fields.Str(require... | true | true |
1c1e71c55c8daaee23cc0e6ae3c8edc6a6eee119 | 125 | py | Python | HackerRank/Python/Mutations.py | AkashSCIENTIST/CompetitiveSolutions | 236db303a21c7195ebf721394a54ce9df70782f5 | [
"Apache-2.0"
] | null | null | null | HackerRank/Python/Mutations.py | AkashSCIENTIST/CompetitiveSolutions | 236db303a21c7195ebf721394a54ce9df70782f5 | [
"Apache-2.0"
] | null | null | null | HackerRank/Python/Mutations.py | AkashSCIENTIST/CompetitiveSolutions | 236db303a21c7195ebf721394a54ce9df70782f5 | [
"Apache-2.0"
] | null | null | null | def mutate_string(string, position, character):
l = list(string)
l[position] = character
return "".join(l)
| 20.833333 | 48 | 0.632 | def mutate_string(string, position, character):
l = list(string)
l[position] = character
return "".join(l)
| true | true |
1c1e723c92009c76fc7076a329888759fb47bbf2 | 2,525 | py | Python | locations/spiders/hibachisan.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/hibachisan.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | locations/spiders/hibachisan.py | mfjackson/alltheplaces | 37c90b4041c80a574e6e4c2f886883e97df4b636 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
class HibachisanSpider(scrapy.Spider):
name = "hibachisan"
item_attributes = {"brand": "Hibachisan"}
allowed_domains = ["hibachisan.com"]
start_urls = [
... | 32.792208 | 88 | 0.522772 |
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
class HibachisanSpider(scrapy.Spider):
name = "hibachisan"
item_attributes = {"brand": "Hibachisan"}
allowed_domains = ["hibachisan.com"]
start_urls = [
"http://www.hiba... | true | true |
1c1e726400a60f4daf375dcead04330105bebdc6 | 2,884 | py | Python | tests/test_resolver.py | zanachka/pypac | 6f97b35aca33bb774f9200ffa3adc80f34e8e9f6 | [
"Apache-2.0"
] | 47 | 2017-06-26T12:08:45.000Z | 2022-03-04T04:42:26.000Z | tests/test_resolver.py | zanachka/pypac | 6f97b35aca33bb774f9200ffa3adc80f34e8e9f6 | [
"Apache-2.0"
] | 52 | 2017-07-21T07:47:05.000Z | 2022-01-04T09:49:35.000Z | tests/test_resolver.py | rbcarson/pypac | 6f97b35aca33bb774f9200ffa3adc80f34e8e9f6 | [
"Apache-2.0"
] | 17 | 2017-11-02T01:09:20.000Z | 2020-12-03T09:36:33.000Z | import pytest
from requests.auth import HTTPProxyAuth
from pypac.parser import PACFile, proxy_url
from pypac.resolver import ProxyResolver, add_proxy_auth, ProxyConfigExhaustedError
mock_proxy_auth = HTTPProxyAuth("user", "pwd")
arbitrary_url = "http://example.org"
def _get_resolver(js_func_return_value, proxy_auth... | 33.929412 | 121 | 0.6862 | import pytest
from requests.auth import HTTPProxyAuth
from pypac.parser import PACFile, proxy_url
from pypac.resolver import ProxyResolver, add_proxy_auth, ProxyConfigExhaustedError
mock_proxy_auth = HTTPProxyAuth("user", "pwd")
arbitrary_url = "http://example.org"
def _get_resolver(js_func_return_value, proxy_auth... | true | true |
1c1e7392e933e63201a8d99340fe5cd948e0ea18 | 8,577 | py | Python | socialserver/util/test.py | niallasher/neosocialserver | 883b841cbb5fe890a7f528fe1b2e0b6555f1c27f | [
"MIT"
] | null | null | null | socialserver/util/test.py | niallasher/neosocialserver | 883b841cbb5fe890a7f528fe1b2e0b6555f1c27f | [
"MIT"
] | 11 | 2022-03-10T04:55:09.000Z | 2022-03-30T14:24:19.000Z | socialserver/util/test.py | niallasher/neosocialserver | 883b841cbb5fe890a7f528fe1b2e0b6555f1c27f | [
"MIT"
] | null | null | null | # Copyright (c) Niall Asher 2022
import re
import pony.orm
import pytest
import requests
from os import getenv
from socialserver.db import create_test_db
from pony.orm import db_session
from socialserver.tests.test_data.test_image import TEST_IMAGE_B64
from socialserver.util.namespace import dict_to_simple_namespace
... | 29.78125 | 115 | 0.705841 |
import re
import pony.orm
import pytest
import requests
from os import getenv
from socialserver.db import create_test_db
from pony.orm import db_session
from socialserver.tests.test_data.test_image import TEST_IMAGE_B64
from socialserver.util.namespace import dict_to_simple_namespace
from socialserver.constants impor... | true | true |
1c1e753a7a317d650f4f5f31e6da636458c104d8 | 1,745 | py | Python | server/SeeAPI/find_food.py | jogaklaa/SeeFood | d064146684db76830d4c03ccd199a74f3d71112e | [
"MIT"
] | null | null | null | server/SeeAPI/find_food.py | jogaklaa/SeeFood | d064146684db76830d4c03ccd199a74f3d71112e | [
"MIT"
] | null | null | null | server/SeeAPI/find_food.py | jogaklaa/SeeFood | d064146684db76830d4c03ccd199a74f3d71112e | [
"MIT"
] | null | null | null | """
A script to ask SeeFood if it sees food in the image at
path specified by the command line argument.
For CEG 4110 by: Derek Doran
contact: derek.doran@wright.edu
Aug 9 2017
"""
import argparse
import numpy as np
import tensorflow as tf
from PIL import Image
parser = argparse.ArgumentParser(description="Ask SeeFo... | 37.12766 | 99 | 0.743266 | """
A script to ask SeeFood if it sees food in the image at
path specified by the command line argument.
For CEG 4110 by: Derek Doran
contact: derek.doran@wright.edu
Aug 9 2017
"""
import argparse
import numpy as np
import tensorflow as tf
from PIL import Image
parser = argparse.ArgumentParser(description="Ask SeeFo... | false | true |
1c1e76859dcda5da3f5cb60cae0cf8808200a398 | 33,794 | py | Python | mypy/plugin.py | thestar19/mypytest | ee45078cfe2c69b61432fa394144a8966b839201 | [
"PSF-2.0"
] | null | null | null | mypy/plugin.py | thestar19/mypytest | ee45078cfe2c69b61432fa394144a8966b839201 | [
"PSF-2.0"
] | 10 | 2020-11-25T23:57:22.000Z | 2021-04-21T23:50:19.000Z | mypy/plugin.py | Vinta-IAAS-Labs/mypy | d326952f88214b36d302c7fcbc92320b3c68fa18 | [
"PSF-2.0"
] | null | null | null | """Plugin system for extending mypy.
At large scale the plugin system works as following:
* Plugins are collected from the corresponding mypy config file option
(either via paths to Python files, or installed Python modules)
and imported using importlib.
* Every module should get an entry point function (called ... | 42.454774 | 99 | 0.678612 |
from abc import abstractmethod
from typing import Any, Callable, List, Tuple, Optional, NamedTuple, TypeVar, Dict
from mypy_extensions import trait, mypyc_attr
from mypy.nodes import (
Expression, Context, ClassDef, SymbolTableNode, MypyFile, CallExpr
)
from mypy.tvar_scope import TypeVarLikeScope
from mypy.types... | true | true |
1c1e7747b8b5ed88abd07d9dc3a39b8bbdeab06f | 923 | py | Python | palantir/db.py | Ithil-protocol/palantir | 48dcfd05a04890c6e49cff16b26e854c026b104b | [
"MIT"
] | null | null | null | palantir/db.py | Ithil-protocol/palantir | 48dcfd05a04890c6e49cff16b26e854c026b104b | [
"MIT"
] | null | null | null | palantir/db.py | Ithil-protocol/palantir | 48dcfd05a04890c6e49cff16b26e854c026b104b | [
"MIT"
] | 1 | 2022-03-03T17:32:03.000Z | 2022-03-03T17:32:03.000Z | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import (
Column,
Float,
Integer,
String,
)
Base = declarative_base()
class Quote(Base):
__tablename__ = "quotes"
id = Column(Integer, primary... | 20.065217 | 62 | 0.686891 | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import (
Column,
Float,
Integer,
String,
)
Base = declarative_base()
class Quote(Base):
__tablename__ = "quotes"
id = Column(Integer, primary... | true | true |
1c1e786617594162549812f224b4671c4016ac53 | 1,490 | py | Python | python/tests/pushSAX.py | balabit-deps/libxml2 | e0c76087bdd489ebed32158d2debb7d3a2fbfcb2 | [
"MIT"
] | 372 | 2016-10-28T10:50:35.000Z | 2022-03-18T19:54:37.000Z | python/tests/pushSAX.py | balabit-deps/libxml2 | e0c76087bdd489ebed32158d2debb7d3a2fbfcb2 | [
"MIT"
] | 317 | 2016-11-02T17:41:48.000Z | 2021-11-08T20:28:19.000Z | source/libxml2-2.7.7/python/tests/pushSAX.py | racker/omnibus | 7f619cee98d551acaef3aed28c85f1c150d0ed8a | [
"Apache-2.0"
] | 107 | 2016-11-03T19:25:16.000Z | 2022-03-20T21:15:22.000Z | #!/usr/bin/python -u
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
log = ""
class callback:
def startDocument(self):
global log
log = log + "startDocument:"
def endDocument(self):
global log
log = log + "endDocument:"
def startElement(self, tag... | 22.923077 | 103 | 0.6 |
import sys
import libxml2
libxml2.debugMemory(1)
log = ""
class callback:
def startDocument(self):
global log
log = log + "startDocument:"
def endDocument(self):
global log
log = log + "endDocument:"
def startElement(self, tag, attrs):
global log
log = ... | false | true |
1c1e78ca08c67af8c166d9fee09045cc017ed6dd | 2,692 | py | Python | examples/adwords/v201506/basic_operations/get_keywords.py | wbrp/googleads-python-lib | c0f8ce6c4acfe88ce8f913a4f0e0e92b548e1022 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201506/basic_operations/get_keywords.py | wbrp/googleads-python-lib | c0f8ce6c4acfe88ce8f913a4f0e0e92b548e1022 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201506/basic_operations/get_keywords.py | wbrp/googleads-python-lib | c0f8ce6c4acfe88ce8f913a4f0e0e92b548e1022 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2015 Google Inc. 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 b... | 30.247191 | 77 | 0.637073 |
"""This example gets all ad group criteria in an account.
To add keywords, run add_keywords.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authenticatio... | false | true |
1c1e78d55e12cb22276430d6e0ef1b6c10925ae8 | 1,749 | py | Python | _unittests/ut_dnotebooks/test_LONG_2A_notebook_eco_scraping.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | _unittests/ut_dnotebooks/test_LONG_2A_notebook_eco_scraping.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | _unittests/ut_dnotebooks/test_LONG_2A_notebook_eco_scraping.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@brief test log(time=23s)
"""
import sys
import os
import unittest
import shutil
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, skipif_appveyor, skipif_travis, add_missing_development_version
try:
import src
except ImportError:
path ... | 30.155172 | 124 | 0.63179 |
import sys
import os
import unittest
import shutil
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, skipif_appveyor, skipif_travis, add_missing_development_version
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.pa... | true | true |
1c1e7940862ddb43e98dc53bd9a9e7e0eae01913 | 38,659 | py | Python | TransMorph/models/TransMorph.py | junyuchen245/TransMorph_Transformer_for_Medical_Image_Registration | dfa24a47a564a000aa9b4eea95a6e83a24568359 | [
"MIT"
] | 82 | 2021-11-23T03:49:21.000Z | 2022-03-31T12:28:08.000Z | TransMorph/models/TransMorph.py | junyuchen245/TransMorph_Transformer_for_Medical_Image_Registration | dfa24a47a564a000aa9b4eea95a6e83a24568359 | [
"MIT"
] | 11 | 2021-12-01T07:58:20.000Z | 2022-03-31T07:18:30.000Z | TransMorph/models/TransMorph.py | junyuchen245/TransMorph_Transformer_for_Medical_Image_Registration | dfa24a47a564a000aa9b4eea95a6e83a24568359 | [
"MIT"
] | 9 | 2021-12-02T05:31:16.000Z | 2022-03-27T05:18:22.000Z | '''
TransMorph model
Swin-Transformer code retrieved from:
https://github.com/SwinTransformer/Swin-Transformer-Semantic-Segmentation
Original paper:
Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., ... & Guo, B. (2021).
Swin transformer: Hierarchical vision transformer using shifted windows.
arXiv prep... | 43.388328 | 171 | 0.560516 |
import torch
import torch.nn as nn
import torch.utils.checkpoint as checkpoint
from timm.models.layers import DropPath, trunc_normal_, to_3tuple
from torch.distributions.normal import Normal
import torch.nn.functional as nnf
import numpy as np
import models.configs_TransMorph as configs
class Mlp(nn.Module)... | true | true |
1c1e7951268bcb446522e8d61eb5b32862200567 | 8,419 | py | Python | py-scripts/rvr_scenario.py | alexman69420/lanforge-scripts | 81e5683c6a6b0eae9336c0bc1b52124e44e7b2be | [
"BSD-2-Clause-FreeBSD",
"BSD-3-Clause"
] | 1 | 2020-12-10T18:46:54.000Z | 2020-12-10T18:46:54.000Z | py-scripts/rvr_scenario.py | MynaITLabs/lanforge-scripts | c905e2a12662f0e3304f0ac29b509c95f09983ce | [
"BSD-2-Clause-FreeBSD",
"BSD-3-Clause"
] | null | null | null | py-scripts/rvr_scenario.py | MynaITLabs/lanforge-scripts | c905e2a12662f0e3304f0ac29b509c95f09983ce | [
"BSD-2-Clause-FreeBSD",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# This script will set the LANforge to a BLANK database then it will load the specified database
# and start a graphical report
import sys
import os
import importlib
import argparse
from pprint import pprint
from time import sleep
if sys.version_info[0] != 3:
print("This script requires Pyth... | 36.445887 | 120 | 0.579998 |
import sys
import os
import importlib
import argparse
from pprint import pprint
from time import sleep
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
LFUtils = importlib.import_module("py-json.LANforge.LFUt... | true | true |
1c1e795e1715dba4dcc4716a3e7d24e47bfb32ae | 21,933 | py | Python | Lib/gzip.py | holmanb/cpython | 9405a02f4c50e235d01d942bd91eb4bea2a86e96 | [
"0BSD"
] | 6 | 2021-09-16T00:02:51.000Z | 2021-09-18T14:26:54.000Z | Lib/gzip.py | holmanb/cpython | 9405a02f4c50e235d01d942bd91eb4bea2a86e96 | [
"0BSD"
] | 14 | 2019-08-19T14:25:23.000Z | 2022-03-01T02:01:04.000Z | Lib/gzip.py | holmanb/cpython | 9405a02f4c50e235d01d942bd91eb4bea2a86e96 | [
"0BSD"
] | 1 | 2019-01-10T10:55:49.000Z | 2019-01-10T10:55:49.000Z | """Functions that read and write gzipped files.
The user of the file doesn't have to worry about the compression,
but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
import struct, sys, time, os
import zlib
import builtins
import io
import _compression
__al... | 35.721498 | 89 | 0.575981 |
import struct, sys, time, os
import zlib
import builtins
import io
import _compression
__all__ = ["BadGzipFile", "GzipFile", "open", "compress", "decompress"]
FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16
READ, WRITE = 1, 2
_COMPRESS_LEVEL_FAST = 1
_COMPRESS_LEVEL_TRADEOFF = 6
_COMPRESS_LEVEL_BEST = 9
... | true | true |
1c1e796f1b2aab8c4578e6a9264d82915465f74d | 3,681 | py | Python | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/get_server_remote_console_option.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/get_server_remote_console_option.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/get_server_remote_console_option.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class GetServerRemoteConsoleOption:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict... | 26.292857 | 79 | 0.560446 |
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class GetServerRemoteConsoleOption:
sensitive_list = []
openapi_types = {
'protocol': 'str',
'type': 'str'
}
attribute_map = {
'protocol': 'protocol',
'type': 'type... | true | true |
1c1e79ee3f30e61e0e7a23b49969ed0a69e96560 | 5,117 | py | Python | utils/utils.py | mlspec/mlspeclib-action-samples-argo | 6c91906c2880fb3817aee29b1d75325d6c551b4a | [
"MIT"
] | null | null | null | utils/utils.py | mlspec/mlspeclib-action-samples-argo | 6c91906c2880fb3817aee29b1d75325d6c551b4a | [
"MIT"
] | null | null | null | utils/utils.py | mlspec/mlspeclib-action-samples-argo | 6c91906c2880fb3817aee29b1d75325d6c551b4a | [
"MIT"
] | null | null | null | import logging
from logging import LogRecord
from io import StringIO
import sys
from pathlib import Path
from mlspeclib import MLObject
if Path("src").exists():
sys.path.append(str(Path("src")))
sys.path.append(str(Path.cwd()))
sys.path.append(str(Path.cwd().parent))
class KnownException(Exception):
pass
d... | 34.342282 | 131 | 0.675982 | import logging
from logging import LogRecord
from io import StringIO
import sys
from pathlib import Path
from mlspeclib import MLObject
if Path("src").exists():
sys.path.append(str(Path("src")))
sys.path.append(str(Path.cwd()))
sys.path.append(str(Path.cwd().parent))
class KnownException(Exception):
pass
d... | true | true |
1c1e7ac4ece63a3a8827f51f0c158b592c949f9c | 10,924 | py | Python | nltk/chunk/named_entity.py | agannon/nltk | 1d7f0d5806bde06b54c6d5185232dd7f3b925e5d | [
"Apache-2.0"
] | 1 | 2020-02-22T11:14:15.000Z | 2020-02-22T11:14:15.000Z | nltk/chunk/named_entity.py | agannon/nltk | 1d7f0d5806bde06b54c6d5185232dd7f3b925e5d | [
"Apache-2.0"
] | null | null | null | nltk/chunk/named_entity.py | agannon/nltk | 1d7f0d5806bde06b54c6d5185232dd7f3b925e5d | [
"Apache-2.0"
] | 1 | 2020-01-21T13:32:09.000Z | 2020-01-21T13:32:09.000Z | # Natural Language Toolkit: Chunk parsing API
#
# Copyright (C) 2001-2019 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Named entity chunker
"""
import os, re, pickle
from xml.etree import ElementTree as ET
from nltk.tag import Classi... | 30.946176 | 87 | 0.549341 |
import os, re, pickle
from xml.etree import ElementTree as ET
from nltk.tag import ClassifierBasedTagger, pos_tag
try:
from nltk.classify import MaxentClassifier
except ImportError:
pass
from nltk.tree import Tree
from nltk.tokenize import word_tokenize
from nltk.data import find
from nltk.chunk.api... | true | true |
1c1e7afa0204d34f4c87738630c23ea1f945d418 | 8,086 | py | Python | tests/test_websockets.py | gfeun/starlette | 66cce0f1c309d1df872652cbb3d23eb543254cdc | [
"BSD-3-Clause"
] | null | null | null | tests/test_websockets.py | gfeun/starlette | 66cce0f1c309d1df872652cbb3d23eb543254cdc | [
"BSD-3-Clause"
] | null | null | null | tests/test_websockets.py | gfeun/starlette | 66cce0f1c309d1df872652cbb3d23eb543254cdc | [
"BSD-3-Clause"
] | null | null | null | import pytest
from starlette.testclient import TestClient
from starlette.websockets import WebSocket, WebSocketDisconnect
def test_websocket_url():
def app(scope):
async def asgi(receive, send):
websocket = WebSocket(scope, receive=receive, send=send)
await websocket.accept()
... | 30.398496 | 83 | 0.612664 | import pytest
from starlette.testclient import TestClient
from starlette.websockets import WebSocket, WebSocketDisconnect
def test_websocket_url():
def app(scope):
async def asgi(receive, send):
websocket = WebSocket(scope, receive=receive, send=send)
await websocket.accept()
... | true | true |
1c1e7b8874e11f5feaca639ccec053fb896101ed | 1,585 | py | Python | src/pybel/io/utils.py | djinnome/pybel | 6ffc1df662fef51f4d740daf6d7643010a9d5be8 | [
"MIT"
] | 103 | 2016-10-25T05:51:26.000Z | 2022-03-23T02:21:12.000Z | src/pybel/io/utils.py | djinnome/pybel | 6ffc1df662fef51f4d740daf6d7643010a9d5be8 | [
"MIT"
] | 444 | 2016-10-22T13:09:10.000Z | 2022-03-21T12:01:39.000Z | src/pybel/io/utils.py | djinnome/pybel | 6ffc1df662fef51f4d740daf6d7643010a9d5be8 | [
"MIT"
] | 38 | 2017-01-06T03:32:38.000Z | 2022-03-19T11:27:30.000Z | # -*- coding: utf-8 -*-
"""This module contains helper functions for other IO functions."""
from .exc import ImportVersionWarning
from ..config import PYBEL_MINIMUM_IMPORT_VERSION
from ..struct import BELGraph
from ..utils import tokenize_version
def raise_for_old_graph(graph):
"""Raise an ImportVersionWarning ... | 35.222222 | 112 | 0.741325 |
from .exc import ImportVersionWarning
from ..config import PYBEL_MINIMUM_IMPORT_VERSION
from ..struct import BELGraph
from ..utils import tokenize_version
def raise_for_old_graph(graph):
graph_version = tokenize_version(graph.pybel_version)
if graph_version < PYBEL_MINIMUM_IMPORT_VERSION:
raise Imp... | true | true |
1c1e7bab5b7c2740a45443bb876be4afbd1db3eb | 26,870 | py | Python | sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_subscriptions.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2021-09-07T18:35:49.000Z | 2021-09-07T18:35:49.000Z | sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_subscriptions.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_subscriptions.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 1 | 2019-04-05T18:17:43.000Z | 2019-04-05T18:17:43.000Z | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import loggi... | 58.034557 | 162 | 0.740305 |
import logging
import pytest
import datetime
import msrest
from azure.servicebus.management import ServiceBusAdministrationClient, SubscriptionProperties
from utilities import get_logger
from azure.core.exceptions import HttpResponseError, ResourceExistsError
from devtools_testutils import AzureMgmtTestCase, Cac... | true | true |
1c1e7c7786cefc4e3b851409dc729446a6cc9c9c | 8,710 | py | Python | pinball/workflow/log_saver.py | DotModus/pinball | deeb4ec20bbd000ad44f7b44e6a7c0fa900dbbea | [
"Apache-2.0"
] | 1,143 | 2015-03-06T22:10:53.000Z | 2022-02-23T21:16:47.000Z | pinball/workflow/log_saver.py | DotModus/pinball | deeb4ec20bbd000ad44f7b44e6a7c0fa900dbbea | [
"Apache-2.0"
] | 70 | 2015-03-06T00:44:39.000Z | 2019-05-01T13:15:10.000Z | pinball/workflow/log_saver.py | DotModus/pinball | deeb4ec20bbd000ad44f7b44e6a7c0fa900dbbea | [
"Apache-2.0"
] | 169 | 2015-03-09T21:27:12.000Z | 2022-03-19T08:09:13.000Z | # Copyright 2015, Pinterest, Inc.
#
# 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... | 34.156863 | 92 | 0.662227 |
"""Logic handling log read/write."""
import abc
import os
import time
from pinball.common import s3_utils
from pinball.config.pinball_config import PinballConfig
from pinball.config.utils import get_log
LOG = get_log('pinball.workflow.log_saver')
__author__ = 'Mao Ye'
__copyright__ = 'Copyright 2015,... | false | true |
1c1e7d8f7c57aa7670306fdb773d5ede6563f289 | 152 | py | Python | mayan/apps/cabinets/tests/literals.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/cabinets/tests/literals.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/cabinets/tests/literals.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | TEST_CABINET_LABEL = 'test cabinet label'
TEST_CABINET_LABEL_EDITED = 'test cabinet edited label'
TEST_CABINET_CHILD_LABEL = 'test cabinet child label'
| 38 | 55 | 0.828947 | TEST_CABINET_LABEL = 'test cabinet label'
TEST_CABINET_LABEL_EDITED = 'test cabinet edited label'
TEST_CABINET_CHILD_LABEL = 'test cabinet child label'
| true | true |
1c1e7e4dfa4fdc350536afdc58a924b3f81240cd | 3,020 | py | Python | veros/diagnostics/cfl_monitor.py | AkasDutta/veros | 9f530596a0148a398829050017de3e01a71261a0 | [
"MIT"
] | 115 | 2019-11-23T02:31:30.000Z | 2022-03-29T12:58:30.000Z | veros/diagnostics/cfl_monitor.py | AkasDutta/veros | 9f530596a0148a398829050017de3e01a71261a0 | [
"MIT"
] | 207 | 2019-11-21T13:21:22.000Z | 2022-03-31T23:36:09.000Z | veros/diagnostics/cfl_monitor.py | AkasDutta/veros | 9f530596a0148a398829050017de3e01a71261a0 | [
"MIT"
] | 21 | 2020-01-28T13:13:39.000Z | 2022-02-02T13:46:33.000Z | from veros import logger
from veros.core.operators import numpy as npx
from veros.diagnostics.base import VerosDiagnostic
from veros.distributed import global_max
class CFLMonitor(VerosDiagnostic):
"""Diagnostic monitoring the maximum CFL number of the solution to detect
instabilities.
Writes output to s... | 34.318182 | 108 | 0.455629 | from veros import logger
from veros.core.operators import numpy as npx
from veros.diagnostics.base import VerosDiagnostic
from veros.distributed import global_max
class CFLMonitor(VerosDiagnostic):
name = "cfl_monitor"
output_frequency = None
def initialize(self, state):
pass
def diagno... | true | true |
1c1e7fbe8bb3ca8a7e9064300646518e96444ec2 | 50,165 | py | Python | assets/src/ba_data/python/ba/_gameactivity.py | Dliwk/ballistica | eaff316b3c6203b2465c768c88c473c1478b492a | [
"MIT"
] | 6 | 2021-04-16T14:25:25.000Z | 2021-11-18T17:20:19.000Z | assets/src/ba_data/python/ba/_gameactivity.py | Dliwk/ballistica | eaff316b3c6203b2465c768c88c473c1478b492a | [
"MIT"
] | 1 | 2021-08-30T10:09:06.000Z | 2021-09-21T10:44:15.000Z | assets/src/ba_data/python/ba/_gameactivity.py | Dliwk/ballistica | eaff316b3c6203b2465c768c88c473c1478b492a | [
"MIT"
] | 2 | 2021-04-20T15:39:27.000Z | 2021-07-18T08:45:56.000Z | # Released under the MIT License. See LICENSE for details.
#
"""Provides GameActivity class."""
# pylint: disable=too-many-lines
from __future__ import annotations
import random
from typing import TYPE_CHECKING, TypeVar
import _ba
from ba._activity import Activity
from ba._score import ScoreConfig
from ba._language ... | 43.023156 | 79 | 0.538184 |
from __future__ import annotations
import random
from typing import TYPE_CHECKING, TypeVar
import _ba
from ba._activity import Activity
from ba._score import ScoreConfig
from ba._language import Lstr
from ba._messages import PlayerDiedMessage, StandMessage
from ba._error import NotFoundError, print_error, print_e... | true | true |
1c1e8023f1385c6cba499b46bd90e93c11617e57 | 4,699 | py | Python | test/functional/mempool_reorg.py | bicosgb/bicos | 83b47498f367558d67ad6476d793973080a4c5a1 | [
"MIT"
] | null | null | null | test/functional/mempool_reorg.py | bicosgb/bicos | 83b47498f367558d67ad6476d793973080a4c5a1 | [
"MIT"
] | null | null | null | test/functional/mempool_reorg.py | bicosgb/bicos | 83b47498f367558d67ad6476d793973080a4c5a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The BICOScoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool re-org scenarios.
Test re-org scenarios with a mempool that contains transactions
that ... | 46.99 | 122 | 0.689508 |
from test_framework.test_framework import BICOScoinTestFramework
from test_framework.util import *
class MempoolCoinbaseTest(BICOScoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.setup_clean_chain = False
self.extra_args = [["-checkmempool"]] ... | true | true |
1c1e80493c180c49c9cfede81726ad275679ac7a | 658 | py | Python | todo/forms.py | mateuswbechert/django-todo | 7a7c2c3827ae493daba24e7bd6d94748b33f76a5 | [
"MIT"
] | null | null | null | todo/forms.py | mateuswbechert/django-todo | 7a7c2c3827ae493daba24e7bd6d94748b33f76a5 | [
"MIT"
] | null | null | null | todo/forms.py | mateuswbechert/django-todo | 7a7c2c3827ae493daba24e7bd6d94748b33f76a5 | [
"MIT"
] | null | null | null | from django import forms
from .models import Todo
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class TodoForm(forms.ModelForm):
class Meta:
model = Todo
# fields = "__all__"
fields = ('title', 'details', 'status')
class N... | 25.307692 | 59 | 0.673252 | from django import forms
from .models import Todo
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class TodoForm(forms.ModelForm):
class Meta:
model = Todo
fields = ('title', 'details', 'status')
class NewUserForm(UserCreati... | true | true |
1c1e80b69b24a8063ccd16e3490b19b6b58a76c0 | 2,334 | py | Python | cat_helper.py | wangzishuo111/bk_zhangdan | 30be7d92c53de4f18d90c00aba1ee73073f47029 | [
"MIT"
] | null | null | null | cat_helper.py | wangzishuo111/bk_zhangdan | 30be7d92c53de4f18d90c00aba1ee73073f47029 | [
"MIT"
] | null | null | null | cat_helper.py | wangzishuo111/bk_zhangdan | 30be7d92c53de4f18d90c00aba1ee73073f47029 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import cat
from base.log import logger
from base.singleton import singleton
@singleton
class CatInit(object):
def __init__(self):
logger().info('cat init')
cat.init("kd.hbase")
@singleton
class CatStage(object):
def __init__(self):
CatInit()
self.__stag... | 21.218182 | 62 | 0.583976 |
import cat
from base.log import logger
from base.singleton import singleton
@singleton
class CatInit(object):
def __init__(self):
logger().info('cat init')
cat.init("kd.hbase")
@singleton
class CatStage(object):
def __init__(self):
CatInit()
self.__stage_map = {}
def st... | true | true |
1c1e80fbc2556cd8d3d024b66cdee8cda2ae1606 | 1,812 | py | Python | setup.py | aidoop/pyaidoop | fa42d0010b95b6641227033700f7dc31844cbe3b | [
"MIT"
] | null | null | null | setup.py | aidoop/pyaidoop | fa42d0010b95b6641227033700f7dc31844cbe3b | [
"MIT"
] | null | null | null | setup.py | aidoop/pyaidoop | fa42d0010b95b6641227033700f7dc31844cbe3b | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
long_description = """A python library for AIdoop web-based application platform such as AIdoop-R and AIdoop-P.
Supports camera operation, object trakcing using tensorflow-based deep learning models, opecv-based image processing
and graphql and websocket to cooperate with w... | 32.945455 | 117 | 0.645695 | from setuptools import setup, find_packages
long_description = """A python library for AIdoop web-based application platform such as AIdoop-R and AIdoop-P.
Supports camera operation, object trakcing using tensorflow-based deep learning models, opecv-based image processing
and graphql and websocket to cooperate with w... | true | true |
1c1e815d166aa42b33cfb751792fd745332af132 | 3,323 | py | Python | shop/shop/settings.py | SmirnoffRD/django_hw | 442e8739937db56aac613c2c3d8d1956cde6fe53 | [
"MIT"
] | null | null | null | shop/shop/settings.py | SmirnoffRD/django_hw | 442e8739937db56aac613c2c3d8d1956cde6fe53 | [
"MIT"
] | null | null | null | shop/shop/settings.py | SmirnoffRD/django_hw | 442e8739937db56aac613c2c3d8d1956cde6fe53 | [
"MIT"
] | null | null | null | """
Django settings for shop project.
Generated by 'django-admin startproject' using Django 2.1.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 24.433824 | 91 | 0.692447 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '=44sv=f$mp$!s$)f(tun_pj_r&q(#g33dl)p*0cyj=gxh8gqv+'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
1c1e841fab4b5a5db5c366c85f5182ca226a6d59 | 7,602 | py | Python | tfx/examples/iris/iris_pipeline_native_keras.py | pingsutw/tfx | bf0d1d74e3f6ea429989fc7b80b82bea08077857 | [
"Apache-2.0"
] | null | null | null | tfx/examples/iris/iris_pipeline_native_keras.py | pingsutw/tfx | bf0d1d74e3f6ea429989fc7b80b82bea08077857 | [
"Apache-2.0"
] | null | null | null | tfx/examples/iris/iris_pipeline_native_keras.py | pingsutw/tfx | bf0d1d74e3f6ea429989fc7b80b82bea08077857 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 Google LLC. 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 req... | 40.652406 | 80 | 0.729282 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from typing import Text
import absl
import tensorflow_model_analysis as tfma
from tfx.components import CsvExampleGen
from tfx.components import Evaluator
from tfx.components import E... | true | true |
1c1e84d8504bd7fb20325a3fd65fe6e7adb80fc3 | 7,306 | py | Python | ceilometer/dispatcher/rpc.py | NeCTAR-RC/ceilometer | 25cb8740b83bfbf5c526be816fa3ae10f936bff5 | [
"Apache-2.0"
] | 1 | 2015-02-26T03:23:09.000Z | 2015-02-26T03:23:09.000Z | ceilometer/dispatcher/rpc.py | NeCTAR-RC/ceilometer | 25cb8740b83bfbf5c526be816fa3ae10f936bff5 | [
"Apache-2.0"
] | null | null | null | ceilometer/dispatcher/rpc.py | NeCTAR-RC/ceilometer | 25cb8740b83bfbf5c526be816fa3ae10f936bff5 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright 2013 IBM Corp
#
# Author: Tong Li <litong01@us.ibm.com>
#
# 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... | 34.462264 | 80 | 0.619217 |
import Queue
import urllib
import urlparse
from oslo.config import cfg
from ceilometer import dispatcher
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils
from ceilometer.openstack.common.rpc import proxy as rpc_proxy
from ceilometer.publisher import utils... | true | true |
1c1e84d9c98d5398d92cdd01445a907414619d20 | 2,357 | py | Python | app/auth/oauth2/resources.py | amigus/python3-demo-api | e1af352a545cc861fdb5e2175c12e9449f7fd16b | [
"MIT"
] | 1 | 2019-12-10T12:18:42.000Z | 2019-12-10T12:18:42.000Z | app/auth/oauth2/resources.py | amigus/python3-demo-api | e1af352a545cc861fdb5e2175c12e9449f7fd16b | [
"MIT"
] | null | null | null | app/auth/oauth2/resources.py | amigus/python3-demo-api | e1af352a545cc861fdb5e2175c12e9449f7fd16b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import logging
from flask import current_app, jsonify
from flask_jwt_extended import create_access_token
from passlib.hash import pbkdf2_sha256
from webargs.flaskparser import use_kwargs
from db.models import User
from .schemas import PasswordGrantSchema
from .. import limiter
fr... | 35.712121 | 88 | 0.644463 |
import datetime
import logging
from flask import current_app, jsonify
from flask_jwt_extended import create_access_token
from passlib.hash import pbkdf2_sha256
from webargs.flaskparser import use_kwargs
from db.models import User
from .schemas import PasswordGrantSchema
from .. import limiter
from . import api
logger... | true | true |
1c1e859331a8e03d4729c80ef303221f70ee5949 | 3,636 | py | Python | starthinker/task/dcm_api/schema/orderDocumentsListResponse.py | dvandra/starthinker | 07a8c1f8bf3c7493b1833d54ca0acc9305a04bc9 | [
"Apache-2.0"
] | 1 | 2019-07-02T18:25:25.000Z | 2019-07-02T18:25:25.000Z | starthinker/task/dcm_api/schema/orderDocumentsListResponse.py | dvandra/starthinker | 07a8c1f8bf3c7493b1833d54ca0acc9305a04bc9 | [
"Apache-2.0"
] | null | null | null | starthinker/task/dcm_api/schema/orderDocumentsListResponse.py | dvandra/starthinker | 07a8c1f8bf3c7493b1833d54ca0acc9305a04bc9 | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2019 Google Inc.
#
# 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
#
# https://www.apache.org/... | 23.921053 | 96 | 0.427393 | true | true | |
1c1e863bae9844a946423d9dd83a734950844a64 | 146,256 | py | Python | AppServer/google/appengine/api/files/file_service_pb.py | loftwah/appscale | 586fc1347ebc743d7a632de698f4dbfb09ae38d6 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | AppServer/google/appengine/api/files/file_service_pb.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | AppServer/google/appengine/api/files/file_service_pb.py | nlake44/appscale | 6944af660ca4cb772c9b6c2332ab28e5ef4d849f | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# 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 o... | 27.02439 | 777 | 0.675398 |
from google.net.proto import ProtocolBuffer
import array
import dummy_thread as thread
__pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
unusednames=printElemNumber,debug_strs no-special"""
if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'):
_extension_runtime = Tr... | true | true |
1c1e865b6cbfac9afd911600b5e7516a14d03045 | 1,360 | py | Python | chest_xray_challenge/logger.py | guruprasaad123/all_dl_projects | 04c869f7f001ef94c467740260663d91a34815e0 | [
"Apache-2.0"
] | 1 | 2021-12-10T16:06:20.000Z | 2021-12-10T16:06:20.000Z | poem_generator/logger.py | guruprasaad123/all_dl_projects | 04c869f7f001ef94c467740260663d91a34815e0 | [
"Apache-2.0"
] | null | null | null | poem_generator/logger.py | guruprasaad123/all_dl_projects | 04c869f7f001ef94c467740260663d91a34815e0 | [
"Apache-2.0"
] | null | null | null | import logging
from logging.handlers import RotatingFileHandler
import os
def get_logger(name, log_path=os.path.join(os.path.dirname(__file__), "main.log"), console=False):
"""
Simple logging wrapper that returns logger
configured to log into file and console.
Args:
name (str): name of logger... | 28.333333 | 98 | 0.630147 | import logging
from logging.handlers import RotatingFileHandler
import os
def get_logger(name, log_path=os.path.join(os.path.dirname(__file__), "main.log"), console=False):
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)... | true | true |
1c1e86aba0ceec2028fa56da07466ed06479e45a | 1,886 | py | Python | python_modules/dagster/dagster_tests/cli_tests/command_tests/test_print_command.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/cli_tests/command_tests/test_print_command.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/cli_tests/command_tests/test_print_command.py | dbatten5/dagster | d76e50295054ffe5a72f9b292ef57febae499528 | [
"Apache-2.0"
] | 1 | 2021-11-30T21:40:46.000Z | 2021-11-30T21:40:46.000Z | import pytest
from click.testing import CliRunner
from dagster.cli.pipeline import execute_print_command, pipeline_print_command
from dagster.core.test_utils import instance_for_test
from dagster.utils import file_relative_path
from .test_cli_commands import (
launch_command_contexts,
valid_external_pipeline_t... | 31.433333 | 100 | 0.694062 | import pytest
from click.testing import CliRunner
from dagster.cli.pipeline import execute_print_command, pipeline_print_command
from dagster.core.test_utils import instance_for_test
from dagster.utils import file_relative_path
from .test_cli_commands import (
launch_command_contexts,
valid_external_pipeline_t... | true | true |
1c1e87d392f1366d9c1bc9e7b53b7e0631dff918 | 2,854 | py | Python | z2/part3/updated_part2_batch/jm/parser_errors_2/975626463.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 1 | 2020-04-16T12:13:47.000Z | 2020-04-16T12:13:47.000Z | z2/part3/updated_part2_batch/jm/parser_errors_2/975626463.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:50:15.000Z | 2020-05-19T14:58:30.000Z | z2/part3/updated_part2_batch/jm/parser_errors_2/975626463.py | kozakusek/ipp-2020-testy | 09aa008fa53d159672cc7cbf969a6b237e15a7b8 | [
"MIT"
] | 18 | 2020-03-06T17:45:13.000Z | 2020-06-09T19:18:31.000Z | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
"""
scenario: test_random_actions
uuid: 975626463
"""
"""
random actions, total chaos
"""
board = gamma_new(3, 5, 3, 7)
assert board is... | 28.257426 | 46 | 0.653819 | from part1 import (
gamma_board,
gamma_busy_fields,
gamma_delete,
gamma_free_fields,
gamma_golden_move,
gamma_golden_possible,
gamma_move,
gamma_new,
)
board = gamma_new(3, 5, 3, 7)
assert board is not None
assert gamma_move(board, 1, 0, 0) == 1
assert gamma_move(board, 1, 0, 3) == 1... | true | true |
1c1e8824680ed5d75dcb55a96c2133397b1fa243 | 2,040 | py | Python | integration-test/744-remove-osm-neighbourhoods.py | rinnyB/vector-datasource | 024909ed8245a4ad4a25c908413ba3602de6c335 | [
"MIT"
] | null | null | null | integration-test/744-remove-osm-neighbourhoods.py | rinnyB/vector-datasource | 024909ed8245a4ad4a25c908413ba3602de6c335 | [
"MIT"
] | 2 | 2021-03-31T20:22:37.000Z | 2021-12-13T20:50:11.000Z | integration-test/744-remove-osm-neighbourhoods.py | rinnyB/vector-datasource | 024909ed8245a4ad4a25c908413ba3602de6c335 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from shapely.wkt import loads as wkt_loads
import dsl
from . import FixtureTest
class RemoveOsmNeighbourhoods(FixtureTest):
def test_no_borough(self):
# Node: Mount Pocono (158473043)
self.generate_fixtures(dsl.way(158473043, wkt_loads('POINT (-75.36462806481801 41.122033... | 65.806452 | 540 | 0.665686 |
from shapely.wkt import loads as wkt_loads
import dsl
from . import FixtureTest
class RemoveOsmNeighbourhoods(FixtureTest):
def test_no_borough(self):
self.generate_fixtures(dsl.way(158473043, wkt_loads('POINT (-75.36462806481801 41.12203367097907)'), {u'gnis:ST_alpha': u'PA', u'gnis:County_num'... | true | true |
1c1e88441423a71ad23b1db4b21a0a8c74920eba | 1,516 | py | Python | {{cookiecutter.project_slug}}/setup.py | vpoulailleau/cookiecutter-pypackage | bcc45c22dcf75987c8f7e48573faa89f15cf4b0a | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/setup.py | vpoulailleau/cookiecutter-pypackage | bcc45c22dcf75987c8f7e48573faa89f15cf4b0a | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/setup.py | vpoulailleau/cookiecutter-pypackage | bcc45c22dcf75987c8f7e48573faa89f15cf4b0a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import find_packages, setup
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = []
setup_requirements = ["pytest-runn... | 31.583333 | 96 | 0.656332 |
from setuptools import find_packages, setup
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
requirements = []
setup_requirements = ["pytest-runner==4.4"]
test_requirements = ["pytest==4.3.1"]
setup(
author=... | true | true |
1c1e88725ce28f198ab07f3abe7444fc53686167 | 317 | py | Python | ch15/countdown.py | rfreiberger/Automate-the-Boring-Stuff | cf1d5a4b05926a64e592817426e9088277cd0193 | [
"BSD-2-Clause"
] | null | null | null | ch15/countdown.py | rfreiberger/Automate-the-Boring-Stuff | cf1d5a4b05926a64e592817426e9088277cd0193 | [
"BSD-2-Clause"
] | null | null | null | ch15/countdown.py | rfreiberger/Automate-the-Boring-Stuff | cf1d5a4b05926a64e592817426e9088277cd0193 | [
"BSD-2-Clause"
] | null | null | null | #! python3
# countdown.py - A simple countdown script.
import time, subprocess
timeLeft = 60
while timeLeft > 0:
print(timeLeft, end='')
time.sleep(1)
timeLeft = timeLeft - 1
# TODO: At the end of the countdown, play a sound file.
subprocess.Popen(['start', 'alarm.wav'], shell=True)
| 17.611111 | 57 | 0.643533 |
import time, subprocess
timeLeft = 60
while timeLeft > 0:
print(timeLeft, end='')
time.sleep(1)
timeLeft = timeLeft - 1
subprocess.Popen(['start', 'alarm.wav'], shell=True)
| false | true |
1c1e889eed8edbc3da690b79b5accf0b9ac237c3 | 3,027 | py | Python | pav_hr/hooks.py | farouk-muha/pav_hr | 91f8c33809b70d38e4212a84f863b7e3cdad4a2c | [
"MIT"
] | null | null | null | pav_hr/hooks.py | farouk-muha/pav_hr | 91f8c33809b70d38e4212a84f863b7e3cdad4a2c | [
"MIT"
] | null | null | null | pav_hr/hooks.py | farouk-muha/pav_hr | 91f8c33809b70d38e4212a84f863b7e3cdad4a2c | [
"MIT"
] | 2 | 2021-05-24T10:32:53.000Z | 2021-12-06T13:57:32.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "pav_hr"
app_title = "PAV HR"
app_publisher = "Farouk Muharram"
app_description = "Partner Add Value in Human Resource Module"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "... | 23.284615 | 78 | 0.671622 |
from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "pav_hr"
app_title = "PAV HR"
app_publisher = "Farouk Muharram"
app_description = "Partner Add Value in Human Resource Module"
app_icon = "octicon octicon-file-directory"
app_color = "grey"
app_email = "farouk1dev@gmail.com"
a... | true | true |
1c1e88b45c80b3a40eecbe9280fd22daf89e1b01 | 2,177 | py | Python | HW4/q3.py | tomersamara/InfoSec | 01f427f7747cbc4e6af9eac609969110dc80bdc7 | [
"MIT"
] | null | null | null | HW4/q3.py | tomersamara/InfoSec | 01f427f7747cbc4e6af9eac609969110dc80bdc7 | [
"MIT"
] | null | null | null | HW4/q3.py | tomersamara/InfoSec | 01f427f7747cbc4e6af9eac609969110dc80bdc7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os, socket
import q2
import assemble
HOST = '127.0.0.1'
SERVER_PORT = 8000
LOCAL_PORT = 1337
ASCII_MAX = 0x7f
def get_raw_shellcode():
return q2.get_shellcode()
def get_shellcode():
# sorry for solve this in morrom method, I dont have time to think on something more crea... | 30.661972 | 141 | 0.665136 |
import os, socket
import q2
import assemble
HOST = '127.0.0.1'
SERVER_PORT = 8000
LOCAL_PORT = 1337
ASCII_MAX = 0x7f
def get_raw_shellcode():
return q2.get_shellcode()
def get_shellcode():
shellcode = get_raw_shellcode()
shellcode_len = len(shellcode)
new_shellcode = []
# ... | true | true |
1c1e88de12c95837a38c08faaee80ce63eb2d619 | 9,348 | py | Python | code/gan_train.py | hliang2/ContrlledAE | c2af71d99b0f79d76c6348c08eca9b11d9e3016e | [
"MIT"
] | 1 | 2020-06-12T17:15:40.000Z | 2020-06-12T17:15:40.000Z | code/gan_train.py | hliang2/ContrlledAE | c2af71d99b0f79d76c6348c08eca9b11d9e3016e | [
"MIT"
] | null | null | null | code/gan_train.py | hliang2/ContrlledAE | c2af71d99b0f79d76c6348c08eca9b11d9e3016e | [
"MIT"
] | null | null | null | import os
import time
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import DataLoader
from config import DATASET_PARAMETERS, NETWORKS_PARAMETERS
from parse_dataset import get_dataset
from network import get_network
from utils import Meter, cycle, save_model, tes... | 38.155102 | 110 | 0.67116 | import os
import time
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import DataLoader
from config import DATASET_PARAMETERS, NETWORKS_PARAMETERS
from parse_dataset import get_dataset
from network import get_network
from utils import Meter, cycle, save_model, tes... | true | true |
1c1e89d481806edd1d91e19e79f8b553ebc605b6 | 8,235 | py | Python | app/botcode_v2/classifier.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 5 | 2020-04-02T12:03:57.000Z | 2020-10-18T19:29:15.000Z | app/botcode_v2/classifier.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 22 | 2020-03-31T02:00:34.000Z | 2021-06-30T17:59:01.000Z | app/botcode_v2/classifier.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 3 | 2020-04-04T16:08:08.000Z | 2020-10-20T01:32:46.000Z |
import os
import datetime
import time
from functools import lru_cache
from dotenv import load_dotenv
import numpy as np
from pandas import DataFrame
import matplotlib.pyplot as plt
from conftest import compile_mock_rt_graph
from app import APP_ENV
from app.decorators.number_decorators import fmt_n, fmt_pct
from app.... | 36.763393 | 185 | 0.647116 |
import os
import datetime
import time
from functools import lru_cache
from dotenv import load_dotenv
import numpy as np
from pandas import DataFrame
import matplotlib.pyplot as plt
from conftest import compile_mock_rt_graph
from app import APP_ENV
from app.decorators.number_decorators import fmt_n, fmt_pct
from app.... | true | true |
1c1e8a8a6a6f08057790a16758b1ffd3fa5633a7 | 4,699 | py | Python | Build a Zerg Bot/zerg_agent_step8Orig.py | Orkestrate/Orkestrate-SC2AI | 2d81ce204ff4b333389dbad52f5f36ca6cb7ac44 | [
"MIT"
] | null | null | null | Build a Zerg Bot/zerg_agent_step8Orig.py | Orkestrate/Orkestrate-SC2AI | 2d81ce204ff4b333389dbad52f5f36ca6cb7ac44 | [
"MIT"
] | null | null | null | Build a Zerg Bot/zerg_agent_step8Orig.py | Orkestrate/Orkestrate-SC2AI | 2d81ce204ff4b333389dbad52f5f36ca6cb7ac44 | [
"MIT"
] | null | null | null | from pysc2.agents import base_agent
from pysc2.env import sc2_env
from pysc2.lib import actions, features, units
from absl import app
import random
class ZergAgent(base_agent.BaseAgent):
def __init__(self):
super(ZergAgent, self).__init__()
self.attack_coordinates = None
def unit_type_is_sel... | 37.592 | 86 | 0.560119 | from pysc2.agents import base_agent
from pysc2.env import sc2_env
from pysc2.lib import actions, features, units
from absl import app
import random
class ZergAgent(base_agent.BaseAgent):
def __init__(self):
super(ZergAgent, self).__init__()
self.attack_coordinates = None
def unit_type_is_sel... | true | true |
1c1e8b567f3cf550373ed8b8f105421284a535f2 | 2,325 | py | Python | test/functional/p2p-timeouts.py | Xangis/gobyte | 376e2163b66aef4dbf5bea98e8ab5aedba3c9441 | [
"MIT"
] | 48 | 2017-11-30T17:11:24.000Z | 2021-10-03T20:48:20.000Z | test/functional/p2p-timeouts.py | Xangis/gobyte | 376e2163b66aef4dbf5bea98e8ab5aedba3c9441 | [
"MIT"
] | 29 | 2017-12-04T03:45:55.000Z | 2022-03-18T03:23:44.000Z | test/functional/p2p-timeouts.py | Xangis/gobyte | 376e2163b66aef4dbf5bea98e8ab5aedba3c9441 | [
"MIT"
] | 102 | 2017-11-04T22:27:46.000Z | 2022-03-04T10:57:28.000Z | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various net timeouts.
- Create three gobyted nodes:
no_verack_node - we never send a verack in re... | 30.592105 | 90 | 0.724731 |
from time import sleep
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class TestNode(P2PInterface):
def on_version(self, message):
pass
class TimeoutsTest(BitcoinTestFramework):
def set_test_params(s... | true | true |
1c1e8bac72be1c641f3754b43f9257e25f73e0b5 | 679 | py | Python | baselines/models/recurrent_phrase_encoder.py | zh123-art/SpatialSense | 477fd6e458377185cd50e05af26825bd14834ffd | [
"BSD-2-Clause"
] | 65 | 2019-08-08T17:50:29.000Z | 2021-11-08T10:40:15.000Z | baselines/models/recurrent_phrase_encoder.py | zh123-art/SpatialSense | 477fd6e458377185cd50e05af26825bd14834ffd | [
"BSD-2-Clause"
] | 5 | 2019-10-09T11:46:25.000Z | 2021-01-30T14:30:19.000Z | baselines/models/recurrent_phrase_encoder.py | zh123-art/SpatialSense | 477fd6e458377185cd50e05af26825bd14834ffd | [
"BSD-2-Clause"
] | 11 | 2019-08-08T02:53:14.000Z | 2022-02-22T14:00:25.000Z | import torch
import torch.nn as nn
class RecurrentPhraseEncoder(nn.Module):
def __init__(self, word_embedding_dim, feature_dim):
super().__init__()
self.feature_dim = feature_dim
self.gru = nn.GRU(
input_size=word_embedding_dim,
hidden_size=feature_dim // 2,
... | 28.291667 | 61 | 0.584683 | import torch
import torch.nn as nn
class RecurrentPhraseEncoder(nn.Module):
def __init__(self, word_embedding_dim, feature_dim):
super().__init__()
self.feature_dim = feature_dim
self.gru = nn.GRU(
input_size=word_embedding_dim,
hidden_size=feature_dim // 2,
... | true | true |
1c1e8ce917e7d54faed43051ba1f4fe5d579df2f | 2,109 | py | Python | topology.py | hectortav/firewall | db9c8166afeed33c79068320f35dbd2c366cc60f | [
"BSD-3-Clause"
] | null | null | null | topology.py | hectortav/firewall | db9c8166afeed33c79068320f35dbd2c366cc60f | [
"BSD-3-Clause"
] | null | null | null | topology.py | hectortav/firewall | db9c8166afeed33c79068320f35dbd2c366cc60f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from mininet.node im... | 31.014706 | 156 | 0.523471 |
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from mininet.node import RemoteController
class MultiSwitchTopo(Topo):
def __init__(self, **opts):
Topo.__init__(self, **opts)
... | false | true |
1c1e8e6fdf3b9f1ae29bde974d2b6522b77680e7 | 4,350 | py | Python | app/lib/server_load.py | SingAREN/radsecproxy_log_analysis | 7d5926df94ec4499710fedf0a9a128e6dc9110ad | [
"Apache-2.0"
] | null | null | null | app/lib/server_load.py | SingAREN/radsecproxy_log_analysis | 7d5926df94ec4499710fedf0a9a128e6dc9110ad | [
"Apache-2.0"
] | null | null | null | app/lib/server_load.py | SingAREN/radsecproxy_log_analysis | 7d5926df94ec4499710fedf0a9a128e6dc9110ad | [
"Apache-2.0"
] | null | null | null | import datetime
import csv
import os
class ServerLoad:
"""Internal class used for checking the request load of the singAren eduroam server"""
def __init__(self):
"""Initialises the accepted and rejected lists for 24 hours"""
self.accepts = [0]*24
self.rejects = [0]*24
@staticmetho... | 41.826923 | 120 | 0.613793 | import datetime
import csv
import os
class ServerLoad:
def __init__(self):
self.accepts = [0]*24
self.rejects = [0]*24
@staticmethod
def update_hour_array(array, time):
time_array = time.split(":")
try:
hour = int(time_array[0])
array[hour] += 1
... | true | true |
1c1e8fc1f8c253a55f5780e4a776dd78cfdcd60e | 1,656 | py | Python | src/viterbi/utils/auth/filter_users.py | gravitationalwavedc/gwlab-viterbi-cw | d9f2d248aeff81cf1572bc2227b85b3ad6941706 | [
"MIT"
] | null | null | null | src/viterbi/utils/auth/filter_users.py | gravitationalwavedc/gwlab-viterbi-cw | d9f2d248aeff81cf1572bc2227b85b3ad6941706 | [
"MIT"
] | null | null | null | src/viterbi/utils/auth/filter_users.py | gravitationalwavedc/gwlab-viterbi-cw | d9f2d248aeff81cf1572bc2227b85b3ad6941706 | [
"MIT"
] | null | null | null | import datetime
import json
import jwt
import requests
from django.conf import settings
def request_filter_users(search, user_id):
"""
Requests a filter of users based on search from the auth service
:param search: The search string to match space separated
:param user_id: The id of the user making ... | 25.090909 | 104 | 0.562802 | import datetime
import json
import jwt
import requests
from django.conf import settings
def request_filter_users(search, user_id):
jwt_enc = jwt.encode(
{
'userId': user_id,
'exp': datetime.datetime.now() + datetime.timedelta(days=30)
},
settings.AUTH_SERVICE... | true | true |
1c1e90ae4fb2080bd3e4a91aa528a1dc0b781e89 | 19,539 | py | Python | com.ibm.streamsx.topology/opt/python/packages/streamsx/spl/op.py | natashadsilva/streamsx.topology | c23f2cb98ca8b77b658c322b11226b9960c35df4 | [
"Apache-2.0"
] | null | null | null | com.ibm.streamsx.topology/opt/python/packages/streamsx/spl/op.py | natashadsilva/streamsx.topology | c23f2cb98ca8b77b658c322b11226b9960c35df4 | [
"Apache-2.0"
] | null | null | null | com.ibm.streamsx.topology/opt/python/packages/streamsx/spl/op.py | natashadsilva/streamsx.topology | c23f2cb98ca8b77b658c322b11226b9960c35df4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016,2018
"""
Integration of SPL operators.
**********************
Invoking SPL Operators
**********************
IBM Streams supports *Stream Processing Language* (SPL),
a domain specific language for streaming analytics.
SPL creates an appli... | 41.308668 | 806 | 0.68417 |
from future.builtins import *
import streamsx.spl.toolkit
import streamsx.topology.exop as exop
import streamsx.topology.runtime
import streamsx.topology.topology
import streamsx._streams._placement as _placement
class Invoke(_placement._Placement, exop.ExtensionOperator):
def __init__(self,topology,kind,inpu... | true | true |
1c1e921d9894d2a90218343ca21a7133e4924aa0 | 961 | py | Python | 08_complex_decisions.py | grandsoggy/Introduction-to-Programming-with-Python | d2deb3c13f5bf9fa3450d3ea1a22cb18879b74b7 | [
"MIT"
] | null | null | null | 08_complex_decisions.py | grandsoggy/Introduction-to-Programming-with-Python | d2deb3c13f5bf9fa3450d3ea1a22cb18879b74b7 | [
"MIT"
] | null | null | null | 08_complex_decisions.py | grandsoggy/Introduction-to-Programming-with-Python | d2deb3c13f5bf9fa3450d3ea1a22cb18879b74b7 | [
"MIT"
] | null | null | null | # This program will calculate Canadian taxes.
# Initialize variables.
orderTotal = 0.00
country = province = "NONE"
# Get user order total.
orderTotal = float(input("Order Total: $"))
# Get user country.
print ("\nWe're glad you're shopping with us!")
print ("What country are you ordering from?")
country = input().up... | 28.264706 | 64 | 0.629553 |
orderTotal = 0.00
country = province = "NONE"
orderTotal = float(input("Order Total: $"))
print ("\nWe're glad you're shopping with us!")
print ("What country are you ordering from?")
country = input().upper()
if country == "CANADA" :
print ("Which province?")
province = input().upper()
if province ==... | true | true |
1c1e9240792234affb0bcaae58b384debb9ed638 | 1,876 | py | Python | tests/expressions/models.py | bpeschier/django | f54c0ec06e390dc5bce95fdccbcb51d6423da4f9 | [
"BSD-3-Clause"
] | 3 | 2020-05-30T17:08:51.000Z | 2021-12-14T02:55:19.000Z | tests/expressions/models.py | bpeschier/django | f54c0ec06e390dc5bce95fdccbcb51d6423da4f9 | [
"BSD-3-Clause"
] | 1 | 2021-03-24T12:21:05.000Z | 2021-03-24T12:31:52.000Z | tests/expressions/models.py | bpeschier/django | f54c0ec06e390dc5bce95fdccbcb51d6423da4f9 | [
"BSD-3-Clause"
] | 4 | 2016-07-31T14:29:15.000Z | 2021-10-19T03:32:44.000Z | """
Tests for F() query expression syntax.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Employee(models.Model):
firstname = models.CharField(max_length=50)
lastname = models.CharField... | 24.684211 | 63 | 0.702026 |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Employee(models.Model):
firstname = models.CharField(max_length=50)
lastname = models.CharField(max_length=50)
salary = models.IntegerFiel... | true | true |
1c1e92822c663c9e14fca05edd7253b4f5f9a1a0 | 4,942 | py | Python | exercises/lookahead_test.py | shashankaryan/re-exercise | c1ce124bc20936de30da2482bdbd7c55f607d8de | [
"MIT"
] | null | null | null | exercises/lookahead_test.py | shashankaryan/re-exercise | c1ce124bc20936de30da2482bdbd7c55f607d8de | [
"MIT"
] | null | null | null | exercises/lookahead_test.py | shashankaryan/re-exercise | c1ce124bc20936de30da2482bdbd7c55f607d8de | [
"MIT"
] | null | null | null | """Tests for lookahead exercises"""
from textwrap import dedent
import unittest
from lookahead import (have_all_vowels, no_repeats, encode_ampersands,
to_pig_latin, camel_to_underscore,
find_broken_links, get_inline_links, get_markdown_links)
class HaveAllVowelsTests(un... | 29.771084 | 79 | 0.625455 | from textwrap import dedent
import unittest
from lookahead import (have_all_vowels, no_repeats, encode_ampersands,
to_pig_latin, camel_to_underscore,
find_broken_links, get_inline_links, get_markdown_links)
class HaveAllVowelsTests(unittest.TestCase):
def test_vowe... | true | true |
1c1e9411a4dbf1ce216cc12c2d8d562d6d6f9baf | 22,143 | py | Python | jni-build/jni/include/tensorflow/tensorboard/backend/handler.py | rcelebi/android-elfali | 4ea14a58a18356ef9e16aba2e7dae84c02afba12 | [
"Apache-2.0"
] | 680 | 2016-12-03T14:38:28.000Z | 2022-02-16T04:06:45.000Z | jni-build/jni/include/tensorflow/tensorboard/backend/handler.py | rcelebi/android-elfali | 4ea14a58a18356ef9e16aba2e7dae84c02afba12 | [
"Apache-2.0"
] | 38 | 2016-11-17T08:43:51.000Z | 2019-11-12T12:27:04.000Z | jni-build/jni/include/tensorflow/tensorboard/backend/handler.py | rcelebi/android-elfali | 4ea14a58a18356ef9e16aba2e7dae84c02afba12 | [
"Apache-2.0"
] | 250 | 2016-12-05T10:37:17.000Z | 2022-03-18T21:26:55.000Z | # Copyright 2015 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... | 35.657005 | 80 | 0.685363 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import gzip
import imghdr
import json
import mimetypes
import os
import re
from six import BytesIO
from six import StringIO
from six.moves import BaseHTTPServer
from six.moves import ... | true | true |
1c1e944aaead432964ab6815d742d1234b4f6e9d | 1,165 | py | Python | app/core/tests/test_model.py | ColeHuntley83/recipe-app-api | da1539e1d28c4e98a3fa455698ea902a00baf3fe | [
"MIT"
] | null | null | null | app/core/tests/test_model.py | ColeHuntley83/recipe-app-api | da1539e1d28c4e98a3fa455698ea902a00baf3fe | [
"MIT"
] | null | null | null | app/core/tests/test_model.py | ColeHuntley83/recipe-app-api | da1539e1d28c4e98a3fa455698ea902a00baf3fe | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
"""tests creating a new user with email"""
email = "cole@iamthebest.com"
password = "Test1234"
user = get_user_model().obj... | 31.486486 | 69 | 0.657511 | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
email = "cole@iamthebest.com"
password = "Test1234"
user = get_user_model().objects.create_user(
email=email,
... | true | true |
1c1e94a6b87cd3fde319757c1600fa4d0a6ba15b | 50 | py | Python | archives/views/__init__.py | by46/archives | b97e2e2d5f413a7702a8980bcb07bd5b46d5a3f8 | [
"MIT"
] | null | null | null | archives/views/__init__.py | by46/archives | b97e2e2d5f413a7702a8980bcb07bd5b46d5a3f8 | [
"MIT"
] | null | null | null | archives/views/__init__.py | by46/archives | b97e2e2d5f413a7702a8980bcb07bd5b46d5a3f8 | [
"MIT"
] | null | null | null | from . import catalogue
from .hooks import hook
| 16.666667 | 24 | 0.76 | from . import catalogue
from .hooks import hook
| true | true |
1c1e94df5f2ed5a96759a1a67b49aacf4847efb8 | 19,516 | py | Python | src/model_utils.py | ghPRao/pneumonia_detectiion_from_chest_xray | 645fa5ac94729ba4d073630688fa340275fd3b8c | [
"MIT"
] | null | null | null | src/model_utils.py | ghPRao/pneumonia_detectiion_from_chest_xray | 645fa5ac94729ba4d073630688fa340275fd3b8c | [
"MIT"
] | null | null | null | src/model_utils.py | ghPRao/pneumonia_detectiion_from_chest_xray | 645fa5ac94729ba4d073630688fa340275fd3b8c | [
"MIT"
] | null | null | null | import tensorflow
from tensorflow import keras
# Keras
from keras.models import Sequential
from keras.layers import Dense, Conv2D , MaxPool2D , Flatten , Dropout , BatchNormalization
from keras.callbacks import ReduceLROnPlateau
from keras.preprocessing.image import ImageDataGenerator
#tqdm
import sys
from sys import... | 45.280742 | 153 | 0.566407 | import tensorflow
from tensorflow import keras
from keras.models import Sequential
from keras.layers import Dense, Conv2D , MaxPool2D , Flatten , Dropout , BatchNormalization
from keras.callbacks import ReduceLROnPlateau
from keras.preprocessing.image import ImageDataGenerator
import sys
from sys import stderr
impo... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.