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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4aad7d61342eb43c7ab5a6792d71b925c81eb8 | 4,918 | py | Python | models/pointnet_cls_rot_transfer.py | OmidPoursaeed/Self_supervised_Learning_Point_Clouds | 4f684cc761347f329eb967823f80522a8a3aedc0 | [
"MIT"
] | 11 | 2020-12-16T16:27:36.000Z | 2021-12-01T04:07:56.000Z | models/pointnet_cls_rot_transfer.py | OmidPoursaeed/Self_supervised_Learning_Point_Clouds | 4f684cc761347f329eb967823f80522a8a3aedc0 | [
"MIT"
] | 2 | 2021-02-09T11:35:01.000Z | 2021-08-06T01:39:42.000Z | models/pointnet_cls_rot_transfer.py | OmidPoursaeed/Self_supervised_Learning_Point_Clouds | 4f684cc761347f329eb967823f80522a8a3aedc0 | [
"MIT"
] | 1 | 2021-08-05T14:07:51.000Z | 2021-08-05T14:07:51.000Z | import tensorflow as tf
import numpy as np
import math
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from transform_nets import input_transform_net, feature_transform_net
def placeholder_inputs(bat... | 44.709091 | 135 | 0.614884 | import tensorflow as tf
import numpy as np
import math
import sys
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(BASE_DIR)
sys.path.append(os.path.join(BASE_DIR, '../utils'))
import tf_util
from transform_nets import input_transform_net, feature_transform_net
def placeholder_inputs(bat... | true | true |
1c4aae5426137d7eb9f5b72856c25b9d57d53549 | 5,219 | py | Python | seaborn/algorithms.py | jwillis0720/seaborn | 0dc93d01c78370e91ebdf72c888719fbbc6d1085 | [
"BSD-3-Clause"
] | null | null | null | seaborn/algorithms.py | jwillis0720/seaborn | 0dc93d01c78370e91ebdf72c888719fbbc6d1085 | [
"BSD-3-Clause"
] | null | null | null | seaborn/algorithms.py | jwillis0720/seaborn | 0dc93d01c78370e91ebdf72c888719fbbc6d1085 | [
"BSD-3-Clause"
] | null | null | null | """Algorithms to support fitting routines in seaborn plotting functions."""
import numbers
import numpy as np
import warnings
from math import sqrt
def wls_confidence_interval(data, z=1.96):
"""Calculate the Wilson score confidence interval for a data set.
data : array of 1-dimensional data, 1's or 0's
z... | 34.335526 | 95 | 0.634796 | import numbers
import numpy as np
import warnings
from math import sqrt
def wls_confidence_interval(data, z=1.96):
n = len(data)
p = len([i for i in data if i]) / n
denominator = 1 + z ** 2 / n
centre_adjusted_probability = p + z * z / (2 * n)
adjusted_standard_deviation = sqrt((p * (1 - p)... | true | true |
1c4aaf705158fbe0e91ecb297f20bdbdacfd197c | 95 | py | Python | siga/prospeccao/apps.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | null | null | null | siga/prospeccao/apps.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | 2 | 2021-03-19T03:21:17.000Z | 2021-03-30T13:24:07.000Z | siga/prospeccao/apps.py | JenniferAmaral/DjangoSpike | 768237bb0f3cffe7bbdbcab38a8bae6faa78e495 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class ProspeccaoConfig(AppConfig):
name = 'prospeccao'
| 15.833333 | 34 | 0.768421 | from django.apps import AppConfig
class ProspeccaoConfig(AppConfig):
name = 'prospeccao'
| true | true |
1c4aaf84e496d0feb65c92950f3a798d787c4fe0 | 4,776 | py | Python | app/storage.py | JB-Tellez/flask-hello-world | 7fce8dea357a847c90bce095b2bfc43036903e4d | [
"MIT"
] | null | null | null | app/storage.py | JB-Tellez/flask-hello-world | 7fce8dea357a847c90bce095b2bfc43036903e4d | [
"MIT"
] | null | null | null | app/storage.py | JB-Tellez/flask-hello-world | 7fce8dea357a847c90bce095b2bfc43036903e4d | [
"MIT"
] | null | null | null | from flask import Flask, jsonify, request
from flask_cors import CORS
from os import environ
import requests
from datetime import datetime
def get_location():
query = request.args.get('data')
api_key = environ.get('GEOCODE_API_KEY')
URL = f'https://maps.googleapis.com/maps/api/geocode/json?address={query... | 24.618557 | 119 | 0.629606 | from flask import Flask, jsonify, request
from flask_cors import CORS
from os import environ
import requests
from datetime import datetime
def get_location():
query = request.args.get('data')
api_key = environ.get('GEOCODE_API_KEY')
URL = f'https://maps.googleapis.com/maps/api/geocode/json?address={query... | true | true |
1c4ab0a1b89ee3ce8f7c20af7b3a0cf0e50ea511 | 1,530 | py | Python | server/models/portfolio/risk.py | lluo5779/Robo-Adviser | 43aa4b73bfc96e55ed664328330a930975596124 | [
"MIT"
] | null | null | null | server/models/portfolio/risk.py | lluo5779/Robo-Adviser | 43aa4b73bfc96e55ed664328330a930975596124 | [
"MIT"
] | 3 | 2021-03-31T19:24:03.000Z | 2021-12-13T20:26:39.000Z | server/models/portfolio/risk.py | lluo5779/Robo-Adviser | 43aa4b73bfc96e55ed664328330a930975596124 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
def risk_prefs(horizon, aversion, cardinal, return_target, l, mu_bl1, mu_bl2, cov_bl1):
if horizon is None:
horizon = 10
alpha = 0.05
safe_target = float(((mu_bl1 + mu_bl2) / 2).mean())
# set the variances for the first period estimates
vars = pd.... | 28.333333 | 143 | 0.594118 | import numpy as np
import pandas as pd
def risk_prefs(horizon, aversion, cardinal, return_target, l, mu_bl1, mu_bl2, cov_bl1):
if horizon is None:
horizon = 10
alpha = 0.05
safe_target = float(((mu_bl1 + mu_bl2) / 2).mean())
vars = pd.DataFrame(np.diag(cov_bl1), index=cov_bl1.index)
... | true | true |
1c4ab187d643a0593fe5cdf9d597191769ebd87f | 2,243 | py | Python | scripts/recalc_afacts.py | EvictionLab/eviction-lab-etl | d94a7e52de8890c9371518b5020d1a6aa3a5fc2e | [
"MIT"
] | 9 | 2018-04-07T17:52:49.000Z | 2020-07-06T01:52:21.000Z | scripts/recalc_afacts.py | EvictionLab/eviction-lab-etl | d94a7e52de8890c9371518b5020d1a6aa3a5fc2e | [
"MIT"
] | 56 | 2017-09-11T21:19:13.000Z | 2020-01-06T18:57:23.000Z | scripts/recalc_afacts.py | EvictionLab/eviction-lab-etl | d94a7e52de8890c9371518b5020d1a6aa3a5fc2e | [
"MIT"
] | 1 | 2019-11-04T18:56:45.000Z | 2019-11-04T18:56:45.000Z | """
Recalculates allocation factors for a given geography level and geographic
correspondence file.
Arguments
----------
argv[1] : str
The geography level to create weights for (block-groups or tracts)
argv[2] : str
The file path to the geography correspondence file
generated from http://mcdc.missouri.edu... | 32.042857 | 89 | 0.628622 |
import sys
import pandas as pd
if __name__ == '__main__':
geocorr_df = pd.read_csv(
sys.argv[2],
dtype={
'county': 'object',
'tract': 'object',
'bg': 'object',
'block': 'object',
'pop2k': 'float64'
})
geocorr_d... | true | true |
1c4ab1e64362cf00e8647c93dc60b6ca75d9cbb0 | 4,371 | py | Python | ui/prefs.py | bfrobin446/openfrontier | bde74dc82be858cd0b0bc64ddfe76020d1179a9c | [
"MIT"
] | null | null | null | ui/prefs.py | bfrobin446/openfrontier | bde74dc82be858cd0b0bc64ddfe76020d1179a9c | [
"MIT"
] | null | null | null | ui/prefs.py | bfrobin446/openfrontier | bde74dc82be858cd0b0bc64ddfe76020d1179a9c | [
"MIT"
] | null | null | null | from PyQt4.QtCore import *
from PyQt4.QtGui import *
import itertools
from . import colors
from . import keys
from .colorbutton import ColorButton
class KeyPicker(QLineEdit):
keyChanged = pyqtSignal(Qt.Key)
def __init__(self, key=None, parent=None, flags=Qt.Widget, **kwargs):
... | 35.25 | 80 | 0.590254 | from PyQt4.QtCore import *
from PyQt4.QtGui import *
import itertools
from . import colors
from . import keys
from .colorbutton import ColorButton
class KeyPicker(QLineEdit):
keyChanged = pyqtSignal(Qt.Key)
def __init__(self, key=None, parent=None, flags=Qt.Widget, **kwargs):
... | true | true |
1c4ab1eafd7a0741e2d75a3e980b2a4775179a92 | 417 | py | Python | backend/tester1000_dev_23525/wsgi.py | crowdbotics-dev/tester1000-dev-23525 | 46c650bdac998a4df3ee19917a09571ec58c0c68 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/tester1000_dev_23525/wsgi.py | crowdbotics-dev/tester1000-dev-23525 | 46c650bdac998a4df3ee19917a09571ec58c0c68 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/tester1000_dev_23525/wsgi.py | crowdbotics-dev/tester1000-dev-23525 | 46c650bdac998a4df3ee19917a09571ec58c0c68 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for tester1000_dev_23525 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(... | 24.529412 | 80 | 0.798561 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tester1000_dev_23525.settings')
application = get_wsgi_application()
| true | true |
1c4ab3589fb7396833431a0bdd7613a3be9d614a | 5,648 | py | Python | openstack/tests/unit/cloud/test_qos_rule_type.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | openstack/tests/unit/cloud/test_qos_rule_type.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | openstack/tests/unit/cloud/test_qos_rule_type.py | catalinpopc/openstacksdk | adaf758076b0c74cf4bb55e88fdee7072764f5f3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 OVH SAS
# 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 applicable law or agreed ... | 37.653333 | 78 | 0.554887 |
from openstack.cloud import exc
from openstack.tests.unit import base
class TestQosRuleType(base.TestCase):
rule_type_name = "bandwidth_limit"
qos_extension = {
"updated": "2015-06-08T10:00:00-00:00",
"name": "Quality of Service",
"links": [],
"alias": "qos",
... | true | true |
1c4ab3b577beb0365924ba95af395d8155ef537a | 1,359 | py | Python | src/niweb/apps/userprofile/views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2018-12-21T09:35:27.000Z | 2019-07-31T18:51:58.000Z | src/niweb/apps/userprofile/views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2019-07-25T07:10:23.000Z | 2021-02-08T09:58:57.000Z | src/niweb/apps/userprofile/views.py | emjemj/ni | a78e6d97d1e4610aad7698c4f0f459221c680b4f | [
"BSD-2-Clause-FreeBSD"
] | 5 | 2019-02-06T12:00:26.000Z | 2021-11-19T14:48:06.000Z | from apps.userprofile.models import UserProfile
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render, get_object_or_404
from actstream.models import actor_stream
@login_required
def list_userprofiles(requ... | 42.46875 | 101 | 0.743194 | from apps.userprofile.models import UserProfile
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.shortcuts import render, get_object_or_404
from actstream.models import actor_stream
@login_required
def list_userprofiles(requ... | true | true |
1c4ab45c50dc2c8013cb457044e00259c45ba137 | 1,102 | py | Python | app/__init__.py | Shindler7/libpraks | c7d09ef7c485d98e4c1d368ae4ebaf70ef77e410 | [
"BSD-3-Clause"
] | 2 | 2020-04-02T13:35:57.000Z | 2020-08-28T09:21:33.000Z | app/__init__.py | Shindler7/libpraks | c7d09ef7c485d98e4c1d368ae4ebaf70ef77e410 | [
"BSD-3-Clause"
] | 4 | 2020-04-12T17:37:25.000Z | 2022-01-13T02:49:04.000Z | app/__init__.py | Shindler7/libpraks | c7d09ef7c485d98e4c1d368ae4ebaf70ef77e410 | [
"BSD-3-Clause"
] | 4 | 2020-04-01T14:11:50.000Z | 2020-05-10T19:20:03.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import logging
from flask import Flask
from flask_images import Images
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy as SQLA
from flask_sslify import SSLify
from flask_wtf.csrf import CSRFProtect
from flask_c... | 20.407407 | 47 | 0.768603 |
import logging
from flask import Flask
from flask_images import Images
from flask_login import LoginManager
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy as SQLA
from flask_sslify import SSLify
from flask_wtf.csrf import CSRFProtect
from flask_cors import CORS
from config import Config
... | true | true |
1c4ab5d0b3ed0c4de6caa36c5588fd3dd0ac2b72 | 8,052 | py | Python | e2e/test_e2e.py | bentobox-dev/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | 1 | 2021-01-02T02:50:15.000Z | 2021-01-02T02:50:15.000Z | e2e/test_e2e.py | joeltio/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | 48 | 2020-10-21T07:42:30.000Z | 2021-02-15T19:34:55.000Z | e2e/test_e2e.py | joeltio/bento-box | 3e10c62f586c1251529e059b6af515d4d03c60e9 | [
"MIT"
] | null | null | null | #
# bento-box
# E2E Test
#
import pytest
from git import Repo
from math import cos, sin
from bento import types
from bento.sim import Simulation
from bento.utils import to_yaml_proto
from bento.graph.plotter import Plotter
from bento.spec.ecs import EntityDef, ComponentDef
from bento.example.specs import Velocity, Po... | 31.453125 | 88 | 0.638847 |
import pytest
from git import Repo
from math import cos, sin
from bento import types
from bento.sim import Simulation
from bento.utils import to_yaml_proto
from bento.graph.plotter import Plotter
from bento.spec.ecs import EntityDef, ComponentDef
from bento.example.specs import Velocity, Position
Meta = Compone... | true | true |
1c4ab5ee42184750c6098b8611c188c2f7b936ac | 7,817 | py | Python | lib/python/treadmill/cli/show.py | drienyov/treadmill | ce21537cd9a2fdb0567ac2aa3de1afcb2f6861de | [
"Apache-2.0"
] | 2 | 2017-10-31T18:48:20.000Z | 2018-03-04T20:35:20.000Z | lib/python/treadmill/cli/show.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/cli/show.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | """Manage Treadmill app manifest.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import click
from six.moves import urllib_parse
from treadmill import cli
from treadmill import restclient
from t... | 32.301653 | 77 | 0.63541 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import click
from six.moves import urllib_parse
from treadmill import cli
from treadmill import restclient
from treadmill import context
from treadmill... | true | true |
1c4ab644d7926e6cc00e6416eef269b9cd3f9640 | 7,055 | py | Python | docs/source/conf.py | dsjoerg/sc2reader | adeb6e3da80e57974b1a29b20e80a02411e693e2 | [
"MIT"
] | 2 | 2016-05-31T14:50:47.000Z | 2021-11-04T20:03:19.000Z | docs/source/conf.py | dsjoerg/sc2reader | adeb6e3da80e57974b1a29b20e80a02411e693e2 | [
"MIT"
] | null | null | null | docs/source/conf.py | dsjoerg/sc2reader | adeb6e3da80e57974b1a29b20e80a02411e693e2 | [
"MIT"
] | 2 | 2017-01-28T09:09:47.000Z | 2017-09-14T14:29:20.000Z | # -*- coding: utf-8 -*-
#
# sc2reader documentation build configuration file, created by
# sphinx-quickstart on Sun May 01 12:39:48 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | 32.511521 | 80 | 0.71949 |
import sys, os
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'sc2reader'
copyright = u'2011'
# |version| and |release|, also used in various other places throu... | true | true |
1c4ab7312d9e6256798662f4b5f774925bdfd988 | 563 | py | Python | HostsTool/gui/__init__.py | zte-lhg/chromium_org | 6174180179b3c6b71c2d93df68e734cadf6d8d49 | [
"Apache-2.0"
] | null | null | null | HostsTool/gui/__init__.py | zte-lhg/chromium_org | 6174180179b3c6b71c2d93df68e734cadf6d8d49 | [
"Apache-2.0"
] | null | null | null | HostsTool/gui/__init__.py | zte-lhg/chromium_org | 6174180179b3c6b71c2d93df68e734cadf6d8d49 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# __init__.py : Declare modules to be called in gui module.
#
# Copyleft (C) 2014 - huhamhire <me@huhamhire.com>
# =====================================================================
# Licensed under the GNU General Public License, version 3. You should
# have received... | 35.1875 | 71 | 0.53286 |
from hostsutil import HostsUtil
__all__ = ["HostsUtil"]
| true | true |
1c4ab74f30c876baed75a6ac1163521f349e3b56 | 3,383 | py | Python | train.py | haziq9978/PythonChatbot | 8eb77140b32a4c6770dab20d4e26be03504ac5ee | [
"MIT"
] | 2 | 2021-01-04T16:23:07.000Z | 2021-01-05T03:25:19.000Z | train.py | haziq9978/PythonChatbot | 8eb77140b32a4c6770dab20d4e26be03504ac5ee | [
"MIT"
] | null | null | null | train.py | haziq9978/PythonChatbot | 8eb77140b32a4c6770dab20d4e26be03504ac5ee | [
"MIT"
] | 1 | 2021-01-04T16:28:57.000Z | 2021-01-04T16:28:57.000Z | import numpy as np
import random
import json
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from nltk_utils import bag_of_words, tokenize, stem
from model import NeuralNet
with open('dataCombine.json', 'r') as f:
intents = json.load(f)
all_words = []
tags = []
xy = []
# loop... | 26.023077 | 74 | 0.657996 | import numpy as np
import random
import json
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from nltk_utils import bag_of_words, tokenize, stem
from model import NeuralNet
with open('dataCombine.json', 'r') as f:
intents = json.load(f)
all_words = []
tags = []
xy = []
for i... | true | true |
1c4ab7a54084ae0c5afba16f8fe6659ad81d8e17 | 3,924 | py | Python | tools/similarity.py | whxf/nlp_api | a63b67287e9a90381cac14bb1c5b723ccbeb14a3 | [
"MIT"
] | 13 | 2019-11-06T02:37:28.000Z | 2022-03-21T06:16:18.000Z | tools/similarity.py | whxf/nlp_api | a63b67287e9a90381cac14bb1c5b723ccbeb14a3 | [
"MIT"
] | null | null | null | tools/similarity.py | whxf/nlp_api | a63b67287e9a90381cac14bb1c5b723ccbeb14a3 | [
"MIT"
] | 4 | 2020-05-07T10:49:32.000Z | 2021-12-31T04:03:19.000Z | """
@author: Li Xi
@file: similarity.py
@time: 2019/10/30 15:37
@desc:
计算文本相似度:
1. WordMoverDistance 基于词移距离的文本相似度计算 【比较文档的相似度】
2. WordVectorSimilarity word-vector的句子相似度计算 【比较句子的相似度】
注意事项:
* 两种方法都需要输入句子分词之后的结果,类型需要时list
* 为提升效率/效果,可对分词结果进行处理,如去除停用词等
* 具体使用方法见文件的最下
* 可自定义加载词向量文件
"""
import os
import gensim
import numpy... | 28.230216 | 83 | 0.622579 | import os
import gensim
import numpy as np
from tools.segment import LtpSegment
class WordMoverDistance(object):
__vector_path = os.path.join("source", "sgns.renmin.word.bz2")
word2vec_model = gensim.models.KeyedVectors.load_word2vec_format(__vector_path)
word2vec_model.init_sims(replace=True)
de... | true | true |
1c4ab877b9f249b4301cd5d7ac6137a0a46850c9 | 1,339 | py | Python | tests/integration_tests/ring_managers_tests/test_horizontals_at_top_scanbeam.py | synapticarbors/wagyu | b98354611dceda8888f2951e9704f843a4e88c27 | [
"MIT"
] | 1 | 2021-01-20T05:49:13.000Z | 2021-01-20T05:49:13.000Z | tests/integration_tests/ring_managers_tests/test_horizontals_at_top_scanbeam.py | synapticarbors/wagyu | b98354611dceda8888f2951e9704f843a4e88c27 | [
"MIT"
] | 1 | 2020-11-20T18:21:24.000Z | 2020-11-20T18:21:37.000Z | tests/integration_tests/ring_managers_tests/test_horizontals_at_top_scanbeam.py | synapticarbors/wagyu | b98354611dceda8888f2951e9704f843a4e88c27 | [
"MIT"
] | 2 | 2020-11-20T18:17:31.000Z | 2021-01-20T14:58:22.000Z | from typing import Tuple
from hypothesis import given
from tests.integration_tests.utils import (
BoundPortedBoundsListsPair,
BoundPortedRingManagersPair,
are_bound_ported_bounds_lists_equal,
are_bound_ported_ring_managers_equal)
from tests.utils import equivalence
from wagyu.hints import Coordinate
f... | 36.189189 | 79 | 0.746826 | from typing import Tuple
from hypothesis import given
from tests.integration_tests.utils import (
BoundPortedBoundsListsPair,
BoundPortedRingManagersPair,
are_bound_ported_bounds_lists_equal,
are_bound_ported_ring_managers_equal)
from tests.utils import equivalence
from wagyu.hints import Coordinate
f... | true | true |
1c4ab8eaeea9b0696f105daca4407d3d104a98ea | 7,518 | py | Python | train_InfoGAN1.py | AnonymousExplorer/Conditional-GANs-Pytorch | 6c15ec67217156d6f041e34efe29ab62f9ef7c7d | [
"MIT"
] | 40 | 2018-12-11T02:14:19.000Z | 2022-03-19T06:16:26.000Z | train_InfoGAN1.py | AnonymousExplorer/Conditional-GANs-Pytorch | 6c15ec67217156d6f041e34efe29ab62f9ef7c7d | [
"MIT"
] | null | null | null | train_InfoGAN1.py | AnonymousExplorer/Conditional-GANs-Pytorch | 6c15ec67217156d6f041e34efe29ab62f9ef7c7d | [
"MIT"
] | 19 | 2019-03-21T19:11:14.000Z | 2022-01-17T05:54:13.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import model
import numpy as np
import pylib
import PIL.Image as Image
import tensorboardX
import torch
import torchvision
import torchvision.datasets as dsets
import torchvision.tr... | 38.357143 | 134 | 0.600958 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import model
import numpy as np
import pylib
import PIL.Image as Image
import tensorboardX
import torch
import torchvision
import torchvision.datasets as dsets
import torchvision.tr... | true | true |
1c4abab21c61cff4175293662effd5d6d19d1025 | 715 | py | Python | test.py | Yvictor/simdjson | 2e43ea714a75def3b55f0d6033acb36e31c6497b | [
"Apache-2.0"
] | null | null | null | test.py | Yvictor/simdjson | 2e43ea714a75def3b55f0d6033acb36e31c6497b | [
"Apache-2.0"
] | null | null | null | test.py | Yvictor/simdjson | 2e43ea714a75def3b55f0d6033acb36e31c6497b | [
"Apache-2.0"
] | null | null | null | import sjson
import json
import pytest
test_case = [
'{"a": 1}',
'{"a": 1.1}',
'{"a": null}',
'{"a": "string test"}',
'{"a": true}',
'{"a": false}',
'{"a": 1, "b": 2}',
'{"a": 1, "b": 2, "c": 3}',
'{"a": 1, "b": 2, "c": 3, "d": 1.1}',
'{"a": [1, 1.1], "b": 2}',
'{"a": [1, 1.... | 24.655172 | 62 | 0.418182 | import sjson
import json
import pytest
test_case = [
'{"a": 1}',
'{"a": 1.1}',
'{"a": null}',
'{"a": "string test"}',
'{"a": true}',
'{"a": false}',
'{"a": 1, "b": 2}',
'{"a": 1, "b": 2, "c": 3}',
'{"a": 1, "b": 2, "c": 3, "d": 1.1}',
'{"a": [1, 1.1], "b": 2}',
'{"a": [1, 1.... | true | true |
1c4abbc45219aa0b02fb8ac79f287143752f95fa | 2,004 | py | Python | netket/hilbert/random/particle.py | VolodyaCO/netket | 629e885212d981d7748d155310abca4a1f9d5481 | [
"Apache-2.0"
] | null | null | null | netket/hilbert/random/particle.py | VolodyaCO/netket | 629e885212d981d7748d155310abca4a1f9d5481 | [
"Apache-2.0"
] | 26 | 2021-08-06T15:27:57.000Z | 2022-03-30T16:55:18.000Z | netket/hilbert/random/particle.py | VolodyaCO/netket | 629e885212d981d7748d155310abca4a1f9d5481 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The NetKet 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 applicable ... | 41.75 | 85 | 0.722056 |
import jax
from jax import numpy as jnp
from netket.hilbert import Particle
from netket.utils.dispatch import dispatch
@dispatch
def random_state(hilb: Particle, key, batches: int, *, dtype):
pbc = jnp.array(hilb.n_particles * hilb.pbc)
boundary = jnp.tile(pbc, (batches, 1))
Ls = jnp.array(... | true | true |
1c4abfe636b358eb142c79f641327426a2e082d1 | 1,273 | py | Python | pychron/furnace/firmware/__init__.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 31 | 2016-03-07T02:38:17.000Z | 2022-02-14T18:23:43.000Z | pychron/furnace/firmware/__init__.py | ASUPychron/pychron | dfe551bdeb4ff8b8ba5cdea0edab336025e8cc76 | [
"Apache-2.0"
] | 1,626 | 2015-01-07T04:52:35.000Z | 2022-03-25T19:15:59.000Z | pychron/furnace/firmware/__init__.py | UIllinoisHALPychron/pychron | f21b79f4592a9fb9dc9a4cb2e4e943a3885ededc | [
"Apache-2.0"
] | 26 | 2015-05-23T00:10:06.000Z | 2022-03-07T16:51:57.000Z | # ===============================================================================
# Copyright 2016 Jake Ross
#
# 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... | 38.575758 | 81 | 0.533386 |
__version__ = "1.0"
PARAMETER_REGISTRY = {
"furnace_env_humidity": "001",
"furnace_env_temperature": "002",
"furnace_setpoint": "003",
"furnace_process_value": "004",
"feeder_position": "021",
"funnel_position": "031",
"switch_status": "041",
}
| true | true |
1c4ac00f27d955404c36f607e418e6eb54dace2d | 199 | py | Python | ui/mock_keyboard.py | amirhertz/SPAGHETTI | 660c4a565846090f73c3cadc3619255bca50d14f | [
"MIT"
] | 10 | 2022-02-03T06:19:13.000Z | 2022-03-29T12:32:19.000Z | ui/mock_keyboard.py | amirhertz/SPAGHETTI | 660c4a565846090f73c3cadc3619255bca50d14f | [
"MIT"
] | null | null | null | ui/mock_keyboard.py | amirhertz/SPAGHETTI | 660c4a565846090f73c3cadc3619255bca50d14f | [
"MIT"
] | null | null | null |
class Key:
ctrl_l = 'control_l'
class Controller:
@staticmethod
def press(key: str) -> str:
return key
@staticmethod
def release(key: str) -> str:
return key
| 13.266667 | 33 | 0.582915 |
class Key:
ctrl_l = 'control_l'
class Controller:
@staticmethod
def press(key: str) -> str:
return key
@staticmethod
def release(key: str) -> str:
return key
| true | true |
1c4ac0d7a55d4170cae7b7ec8b9808ffa64edcae | 910 | py | Python | dsvfile/Models/FactorySystem/InserterComponent.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | 2 | 2021-03-01T19:57:20.000Z | 2021-08-02T20:54:48.000Z | dsvfile/Models/FactorySystem/InserterComponent.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | null | null | null | dsvfile/Models/FactorySystem/InserterComponent.py | phoenixx-666/dsvread | 8a073c12343b2f0d34f9b728282dfefe10999f24 | [
"MIT"
] | null | null | null | from ...Fields import Int16Field, FloatField, BoolField
from ...Fields.Enums import EInserterStage, EItem
from . import Model, Int32Field
class InserterComponent(Model):
version = Int32Field()
id = Int32Field()
entityId = Int32Field()
pcId = Int32Field()
stage = EInserterStage()
speed = Int32F... | 26 | 55 | 0.653846 | from ...Fields import Int16Field, FloatField, BoolField
from ...Fields.Enums import EInserterStage, EItem
from . import Model, Int32Field
class InserterComponent(Model):
version = Int32Field()
id = Int32Field()
entityId = Int32Field()
pcId = Int32Field()
stage = EInserterStage()
speed = Int32F... | true | true |
1c4ac1528db9a11fa760116b25f5da776d7843b1 | 7,422 | py | Python | ncappzoo/apps/object-detector/object-detector.py | yockgen/movidius | cc32f1951a4d00d2250bb0d2b9000c5f2435b41a | [
"MIT"
] | null | null | null | ncappzoo/apps/object-detector/object-detector.py | yockgen/movidius | cc32f1951a4d00d2250bb0d2b9000c5f2435b41a | [
"MIT"
] | null | null | null | ncappzoo/apps/object-detector/object-detector.py | yockgen/movidius | cc32f1951a4d00d2250bb0d2b9000c5f2435b41a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# ****************************************************************************
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
# ****************************************************************************
# How to run Single Shot Multibox Detectors (SSD)
... | 35.511962 | 97 | 0.551603 |
import os
import sys
import numpy as np
import ntpath
import argparse
import skimage.io
import skimage.transform
import mvnc.mvncapi as mvnc
from utils import visualize_output
from utils import deserialize_output
CONFIDANCE_THRESHOLD = 0.60
ARGS = None
def open_ncs_device():
... | true | true |
1c4ac1901b03408ddb92516d19c818932cbc8832 | 2,161 | py | Python | app/auth/forms.py | pointerboy/ModHub | 5b2bdf31bdf409c677e1009f879794f91e636a7b | [
"MIT"
] | null | null | null | app/auth/forms.py | pointerboy/ModHub | 5b2bdf31bdf409c677e1009f879794f91e636a7b | [
"MIT"
] | 1 | 2022-01-13T02:52:49.000Z | 2022-01-13T02:52:49.000Z | app/auth/forms.py | pointerboy/ModHub | 5b2bdf31bdf409c677e1009f879794f91e636a7b | [
"MIT"
] | null | null | null | from flask_babel import _, lazy_gettext as _l
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo, Length
from wtforms_validators import AlphaNumeric
from app.models import User
class L... | 43.22 | 143 | 0.672837 | from flask_babel import _, lazy_gettext as _l
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import ValidationError, DataRequired, Email, EqualTo, Length
from wtforms_validators import AlphaNumeric
from app.models import User
class L... | true | true |
1c4ac1e423458e0a0a187f8698a9e64231b6a196 | 3,067 | py | Python | tube/tests/test_tflAPI.py | adamgilman/tube-python | 3d94e79f7d367eed95ed68b53d0ab13a36cc3219 | [
"BSD-3-Clause"
] | 5 | 2017-01-26T00:06:08.000Z | 2020-06-03T16:07:09.000Z | tube/tests/test_tflAPI.py | adamgilman/tube-python | 3d94e79f7d367eed95ed68b53d0ab13a36cc3219 | [
"BSD-3-Clause"
] | null | null | null | tube/tests/test_tflAPI.py | adamgilman/tube-python | 3d94e79f7d367eed95ed68b53d0ab13a36cc3219 | [
"BSD-3-Clause"
] | 1 | 2021-11-22T16:23:14.000Z | 2021-11-22T16:23:14.000Z | import unittest
from tube.tflAPI import TFLapi
import vcr
my_vcr = vcr.VCR(
serializer = 'json',
cassette_library_dir = 'tube/tests/fixtures/cassettes',
record_mode = 'once',
match_on = ['uri', 'method'],
)
import logging
logging.basicConfig() # you need to initialize logging, otherwise you will not see anything... | 44.449275 | 109 | 0.750245 | import unittest
from tube.tflAPI import TFLapi
import vcr
my_vcr = vcr.VCR(
serializer = 'json',
cassette_library_dir = 'tube/tests/fixtures/cassettes',
record_mode = 'once',
match_on = ['uri', 'method'],
)
import logging
logging.basicConfig()
vcr_log = logging.getLogger("vcr")
vcr_log.setLevel(logging.ERROR)
... | true | true |
1c4ac264208d85dfc358c39ac2b842a93a43d268 | 2,008 | py | Python | nova/db/sqlalchemy/migrate_repo/versions/087_add_uuid_to_bw_usage_cache.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | null | null | null | nova/db/sqlalchemy/migrate_repo/versions/087_add_uuid_to_bw_usage_cache.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T14:14:13.000Z | 2020-07-24T14:14:13.000Z | nova/db/sqlalchemy/migrate_repo/versions/087_add_uuid_to_bw_usage_cache.py | bopopescu/extra-specs-1 | 6a14d8d7807727023b4d589af47e8a9605f12db1 | [
"Apache-2.0"
] | 1 | 2020-07-24T10:40:59.000Z | 2020-07-24T10:40:59.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC.
#
# 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
#
... | 34.033898 | 78 | 0.697709 |
from sqlalchemy import Boolean, Column, DateTime, BigInteger
from sqlalchemy import MetaData, Integer, String, Table
from nova import log as logging
LOG = logging.getLogger(__name__)
def upgrade(migrate_engine):
meta = MetaData()
meta.bind = migrate_engine
bw_usage_cache = Table('b... | true | true |
1c4ac32fd1e2599ccd47b8d66ea9daef42b250e7 | 2,232 | py | Python | tests/test_weighting.py | DimitrisAlivas/StarQE | c17676e5f1e3f19c0c4c117a50abe2ce22ffef28 | [
"MIT"
] | 11 | 2021-06-17T15:01:36.000Z | 2022-02-04T16:48:27.000Z | tests/test_weighting.py | DimitrisAlivas/StarQE | c17676e5f1e3f19c0c4c117a50abe2ce22ffef28 | [
"MIT"
] | null | null | null | tests/test_weighting.py | DimitrisAlivas/StarQE | c17676e5f1e3f19c0c4c117a50abe2ce22ffef28 | [
"MIT"
] | 1 | 2022-03-28T03:55:33.000Z | 2022-03-28T03:55:33.000Z | """Tests for weighting."""
from typing import Any, MutableMapping
import torch
import unittest_templates
from mphrqe.layer.weighting import AttentionMessageWeighting, MessageWeighting, SymmetricMessageWeighting
class MessageWeightingTests(unittest_templates.GenericTestCase[MessageWeighting]):
"""Tests for messa... | 30.162162 | 114 | 0.68862 | from typing import Any, MutableMapping
import torch
import unittest_templates
from mphrqe.layer.weighting import AttentionMessageWeighting, MessageWeighting, SymmetricMessageWeighting
class MessageWeightingTests(unittest_templates.GenericTestCase[MessageWeighting]):
num_entities: int = 33
num_edges: int = ... | true | true |
1c4ac39c33fc74a087b76922f9853b80be409055 | 1,078 | py | Python | seedorf/sports/migrations/0003_add_sport_category_table_tennis.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | 3 | 2018-04-22T10:11:01.000Z | 2018-11-16T22:00:34.000Z | seedorf/sports/migrations/0003_add_sport_category_table_tennis.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | 87 | 2018-03-14T13:42:55.000Z | 2022-03-21T21:15:16.000Z | seedorf/sports/migrations/0003_add_sport_category_table_tennis.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2019-03-29 13:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sports", "0002_auto_20180602_2110")]
operations = [
migrations.AlterField(
model_name="sport",
name="category",
field... | 31.705882 | 82 | 0.454545 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("sports", "0002_auto_20180602_2110")]
operations = [
migrations.AlterField(
model_name="sport",
name="category",
field=models.CharField(
choices=[
... | true | true |
1c4ac3f3a8c481f3e1541b4748ebe97e017ea4e8 | 1,239 | py | Python | BaseAdapter/EUAOSSHClient.py | leonevo/euao | ff7a2c9fa76c4eed297856ef82ac3d2baa8976c1 | [
"Apache-2.0"
] | 2 | 2015-01-16T07:36:19.000Z | 2017-03-10T06:11:55.000Z | BaseAdapter/EUAOSSHClient.py | leonevo/euao | ff7a2c9fa76c4eed297856ef82ac3d2baa8976c1 | [
"Apache-2.0"
] | null | null | null | BaseAdapter/EUAOSSHClient.py | leonevo/euao | ff7a2c9fa76c4eed297856ef82ac3d2baa8976c1 | [
"Apache-2.0"
] | null | null | null | import paramiko
class EUAOSSHClient(paramiko.SSHClient):
## overload the exec_command method
def exec_command(self, command, bufsize=-1, timeout=None):
chan = self._transport.open_session()
chan.settimeout(timeout)
chan.exec_command(command)
stdin = chan.makefile('wb', bu... | 72.882353 | 497 | 0.727199 | import paramiko
class EUAOSSHClient(paramiko.SSHClient):
bufsize=-1, timeout=None):
chan = self._transport.open_session()
chan.settimeout(timeout)
chan.exec_command(command)
stdin = chan.makefile('wb', bufsize)
stdout = chan.makefile('rb', bufsize)
stderr =... | true | true |
1c4ac43fe52487a7f0bd887554dc6cd88c8beb6f | 3,233 | py | Python | maml_examples/cluster_maml_trpo_ant.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | maml_examples/cluster_maml_trpo_ant.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | maml_examples/cluster_maml_trpo_ant.py | JakobStruye/maml_rl | ec92a5138127a86a4c15925c70e61dbdf038cd18 | [
"MIT"
] | null | null | null | from sandbox.rocky.tf.algos.maml_trpo import MAMLTRPO
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.baselines.gaussian_mlp_baseline import GaussianMLPBaseline
from rllab.envs.mujoco.ant_env_rand import AntEnvRand
from rllab.envs.mujoco.ant_env_rand_goal import AntEnvRandGoal
from ... | 29.66055 | 174 | 0.666564 | from sandbox.rocky.tf.algos.maml_trpo import MAMLTRPO
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline
from rllab.baselines.gaussian_mlp_baseline import GaussianMLPBaseline
from rllab.envs.mujoco.ant_env_rand import AntEnvRand
from rllab.envs.mujoco.ant_env_rand_goal import AntEnvRandGoal
from ... | true | true |
1c4ac4962fab48761d3549b1ff774f9ba8c83d10 | 3,182 | py | Python | v2/cleanup/clean_relatedness_data.py | amoudgl/pun-model | bf18335a58ecfb8624d5b40b619a2bf7bbb72714 | [
"BSD-3-Clause"
] | 13 | 2019-04-18T10:09:16.000Z | 2022-03-01T21:42:51.000Z | v2/cleanup/clean_relatedness_data.py | amoudgl/pun-model | bf18335a58ecfb8624d5b40b619a2bf7bbb72714 | [
"BSD-3-Clause"
] | 1 | 2022-03-01T22:24:14.000Z | 2022-03-01T22:24:14.000Z | v2/cleanup/clean_relatedness_data.py | amoudgl/pun-model | bf18335a58ecfb8624d5b40b619a2bf7bbb72714 | [
"BSD-3-Clause"
] | 3 | 2019-04-16T03:21:50.000Z | 2021-06-04T05:34:08.000Z | #!/usr/bin/env python3
from utils import data2numpy, map_puntypeID_to_idx
relatedness_near_datapath = ("./wordPair_relatedness_" +
"smoothedTrigrams_near.csv")
relatedness_identical_datapath = ("./wordPair_relatedness_" +
"smoothedTrigrams_identical.csv")
... | 31.196078 | 79 | 0.650849 |
from utils import data2numpy, map_puntypeID_to_idx
relatedness_near_datapath = ("./wordPair_relatedness_" +
"smoothedTrigrams_near.csv")
relatedness_identical_datapath = ("./wordPair_relatedness_" +
"smoothedTrigrams_identical.csv")
meanings = {}
puns_d... | true | true |
1c4ac5f669e93e7f785530f47d72998b4960e2bd | 745 | py | Python | mvc/router.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | mvc/router.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | mvc/router.py | yashpokar/mvc | f524973739bfd63a85dfa06bdfc7fd62472c19dc | [
"MIT"
] | null | null | null | from werkzeug.routing import Map, Rule
class Router:
_registry = {}
_controllers = {}
@staticmethod
def get(pattern, callback):
Router._register('GET', pattern, callback)
@staticmethod
def post(pattern, callback):
Router._register('POST', pattern, callback)
@staticmethod... | 25.689655 | 89 | 0.601342 | from werkzeug.routing import Map, Rule
class Router:
_registry = {}
_controllers = {}
@staticmethod
def get(pattern, callback):
Router._register('GET', pattern, callback)
@staticmethod
def post(pattern, callback):
Router._register('POST', pattern, callback)
@staticmethod... | true | true |
1c4ac5f9721e8cfa983599bd81afe585bdecdf5f | 2,530 | py | Python | config/settings/local.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | config/settings/local.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | config/settings/local.py | gladgod/zhiliao | 573dfbe56734388c9657cb6749d267f4a8885d5b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
'''
import environ
from .mysqlconf import *
from .common import * # noqa
# mezzanine app settings
from .mezzaconf import *
# DEBUG
# --------------------------... | 29.418605 | 99 | 0.549407 |
import environ
from .mysqlconf import *
from .common import *
from .mezzaconf import *
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
Y = env("DJANGO_SECRET_KEY", default='dwqfjwf&q-8+#ko-#8k)jpf#h8bp(@515@x@l#=w3ktswereue')
EMAIL_HOST = 'localhost'
EMAIL_PORT =... | true | true |
1c4ac6ac9b7ea1e11c442e577ca5452024f8d69a | 4,309 | py | Python | main.py | jakestrouse00/Python-Art | f5ddea614789ef8e13881f888f80b94d6aae5f9e | [
"MIT"
] | 1 | 2020-03-05T08:54:29.000Z | 2020-03-05T08:54:29.000Z | main.py | jakestrouse00/Python-Art | f5ddea614789ef8e13881f888f80b94d6aae5f9e | [
"MIT"
] | null | null | null | main.py | jakestrouse00/Python-Art | f5ddea614789ef8e13881f888f80b94d6aae5f9e | [
"MIT"
] | null | null | null | from turtle import *
import random
import threading
from tkinter import *
# generate random seed
num = random.randint(1897348294, 18495729473285739)
print("\n\nUsing Seed: " + str(num))
# set the seed for all randomization
random.seed(num)
# save the current seed to a text file
with open('current_seed.txt', 'w') as f:... | 26.115152 | 80 | 0.635182 | from turtle import *
import random
import threading
from tkinter import *
num = random.randint(1897348294, 18495729473285739)
print("\n\nUsing Seed: " + str(num))
random.seed(num)
with open('current_seed.txt', 'w') as f:
f.write(str(num))
colors = ['blue', 'red', 'purple', 'yellow', 'green', 'orange', 'hot_co... | true | true |
1c4ac7c71bb9d7a5423ddf8200fe2fede8b354f7 | 87 | py | Python | python/testData/docstrings/googleDescriptionOfReturnValueOnNextLine.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/docstrings/googleDescriptionOfReturnValueOnNextLine.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/docstrings/googleDescriptionOfReturnValueOnNextLine.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | def func():
"""
Returns:
int:
return value description
""" | 14.5 | 33 | 0.448276 | def func(): | true | true |
1c4ac865607d0326e4cf6dc830274b68eb3d48d7 | 28 | py | Python | pyrcc/__init__.py | vishalbelsare/pyrcc | 3dfb9721a41f5c253690fd42a4540f639534ce9b | [
"MIT"
] | 96 | 2017-09-16T16:00:51.000Z | 2021-12-07T07:53:57.000Z | pyrcc/__init__.py | jtpils/pyrcc | 3dfb9721a41f5c253690fd42a4540f639534ce9b | [
"MIT"
] | 1 | 2021-04-21T16:49:23.000Z | 2021-04-21T16:49:23.000Z | pyrcc/__init__.py | jtpils/pyrcc | 3dfb9721a41f5c253690fd42a4540f639534ce9b | [
"MIT"
] | 30 | 2017-09-18T01:18:13.000Z | 2020-05-05T05:43:54.000Z | from .rcc import RccCluster
| 14 | 27 | 0.821429 | from .rcc import RccCluster
| true | true |
1c4ac916ab8d1749743c2e814fb947997a9a280c | 4,709 | py | Python | utils.py | NateEaton/igrill | 30caa7af3d6861ecfcb004fb34dfc7c316ff7b74 | [
"MIT"
] | null | null | null | utils.py | NateEaton/igrill | 30caa7af3d6861ecfcb004fb34dfc7c316ff7b74 | [
"MIT"
] | null | null | null | utils.py | NateEaton/igrill | 30caa7af3d6861ecfcb004fb34dfc7c316ff7b74 | [
"MIT"
] | null | null | null | from builtins import range
from config import strip_config
from igrill import IGrillMiniPeripheral, IGrillV2Peripheral, IGrillV3Peripheral, Pulse2000Peripheral, DeviceThread
import logging
import paho.mqtt.client as mqtt
config_requirements = {
'specs': {
'required_entries': {'devices': list, 'mqtt': dict}... | 35.141791 | 114 | 0.551922 | from builtins import range
from config import strip_config
from igrill import IGrillMiniPeripheral, IGrillV2Peripheral, IGrillV3Peripheral, Pulse2000Peripheral, DeviceThread
import logging
import paho.mqtt.client as mqtt
config_requirements = {
'specs': {
'required_entries': {'devices': list, 'mqtt': dict}... | true | true |
1c4ac9638d00c55a6fc59df6fd2a50f24ece27ef | 563 | py | Python | pythonExercicios/ex115/sistema.py | Yhago-Carvalho/CursoPython | 343ccabb1a61e16c6078de9672c78c56deed2589 | [
"MIT"
] | null | null | null | pythonExercicios/ex115/sistema.py | Yhago-Carvalho/CursoPython | 343ccabb1a61e16c6078de9672c78c56deed2589 | [
"MIT"
] | null | null | null | pythonExercicios/ex115/sistema.py | Yhago-Carvalho/CursoPython | 343ccabb1a61e16c6078de9672c78c56deed2589 | [
"MIT"
] | null | null | null | from lib.arquivo import *
from lib.interface import *
if not arquivo_existe('cursoemvideo.txt'):
criar_arquivo('cursoemvideo.txt')
while True:
o = menu('Sua opção: ')
if o == 1:
#Mostra as pessoas cadastradas
ler_arquivo('cursoemvideo.txt')
elif o == 2:
#Cadastra uma pessoa
... | 26.809524 | 50 | 0.598579 | from lib.arquivo import *
from lib.interface import *
if not arquivo_existe('cursoemvideo.txt'):
criar_arquivo('cursoemvideo.txt')
while True:
o = menu('Sua opção: ')
if o == 1:
ler_arquivo('cursoemvideo.txt')
elif o == 2:
titulo('NOVO CADASTRO')
nome = input(... | true | true |
1c4ac9be98e27c1ea3752c2bd2d934194b92a207 | 1,492 | py | Python | tweepy-bots/followerextract.py | kassuahun/Twitterprj | 23c7272201a0a62f2aaa9d1081a5f1d74b66b144 | [
"Apache-2.0"
] | null | null | null | tweepy-bots/followerextract.py | kassuahun/Twitterprj | 23c7272201a0a62f2aaa9d1081a5f1d74b66b144 | [
"Apache-2.0"
] | null | null | null | tweepy-bots/followerextract.py | kassuahun/Twitterprj | 23c7272201a0a62f2aaa9d1081a5f1d74b66b144 | [
"Apache-2.0"
] | null | null | null | import tweepy
import time
import sys
from datetime import datetime
from config import create_api, create_api_List, create_api_test
from limits import limits
import random
import os
import utils
import logging
import atexit
api = create_api()
# the ID of the user
id = 1168167671151628290
# fetching the user
user... | 26.642857 | 88 | 0.654155 | import tweepy
import time
import sys
from datetime import datetime
from config import create_api, create_api_List, create_api_test
from limits import limits
import random
import os
import utils
import logging
import atexit
api = create_api()
id = 1168167671151628290
user = api.get_user(id)
print("USER NAME =... | true | true |
1c4aca9d8963bb2cd9e31b728c9373a6ac656cdd | 16,441 | py | Python | dovetail/utils/dovetail_utils.py | xudan16/dovetail | 6230a0d2c47c32d970f3197021efee8f9669282b | [
"Apache-2.0"
] | 3 | 2018-11-14T14:42:45.000Z | 2018-12-20T21:56:48.000Z | dovetail/utils/dovetail_utils.py | xudan16/dovetail | 6230a0d2c47c32d970f3197021efee8f9669282b | [
"Apache-2.0"
] | 4 | 2021-03-25T21:57:27.000Z | 2021-09-23T23:21:52.000Z | dovetail/utils/dovetail_utils.py | xudan16/dovetail | 6230a0d2c47c32d970f3197021efee8f9669282b | [
"Apache-2.0"
] | 20 | 2016-11-11T06:38:14.000Z | 2020-10-25T16:48:12.000Z | #!/usr/bin/env python
#
# Copyright (c) 2018 grakiss.wanglei@huawei.com and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LIC... | 35.819172 | 78 | 0.599051 |
from __future__ import print_function
import sys
import os
import re
import requests
import subprocess
from collections import Mapping, Set, Sequence
import json
from datetime import datetime
from distutils.version import LooseVersion
import yaml
import python_hosts
import docker
from docker.types import Moun... | true | true |
1c4acc2f700ed5667eb91162f430658b3774cfda | 4,744 | py | Python | webassign_grades_to_brightspace/webassign_grades_to_brightspace.py | christopherphan/brightspace-scripts | 6cfc588a9f0f3208f73fd5a893d0197d3dfeab50 | [
"MIT"
] | 1 | 2020-09-17T19:48:10.000Z | 2020-09-17T19:48:10.000Z | webassign_grades_to_brightspace/webassign_grades_to_brightspace.py | christopherphan/brightspace-scripts | 6cfc588a9f0f3208f73fd5a893d0197d3dfeab50 | [
"MIT"
] | null | null | null | webassign_grades_to_brightspace/webassign_grades_to_brightspace.py | christopherphan/brightspace-scripts | 6cfc588a9f0f3208f73fd5a893d0197d3dfeab50 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# webassign_grades_to_brightspace.py
#
# Christopher L. Phan, Ph.D.
# cphan@chrisphan.com
# Last updated: 2019-05-23
#
#################################
# Copyright (c) 2019 Christopher L. Phan
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software a... | 37.0625 | 103 | 0.634907 |
and email)
* A "WebAssignUsername" field with their WebAssign Username
Second is the WebAssign grade export, exported in "tsv" format.
syntax: ./webassign_grades_to_brightspace.py d2l-input-file WeBWorK-input-file D2L-output-file
"""
import csv
import sys
if len(sys.argv) != 4:
print(help_string)
sy... | true | true |
1c4acc4771c6410e1e1685fee0d975f4b24e233e | 370 | py | Python | output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/any_uri/schema_instance/nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.nist_data.atomic.any_uri.schema_instance.nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd.nistschema_sv_iv_atomic_any_uri_enumeration_5 import (
NistschemaSvIvAtomicAnyUriEnumeration5,
NistschemaSvIvAtomicAnyUriEnumeration5Type,
)
__all__ = [
"NistschemaSvIvAtomicAnyUriEnumeration5",
... | 37 | 164 | 0.864865 | from output.models.nist_data.atomic.any_uri.schema_instance.nistschema_sv_iv_atomic_any_uri_enumeration_5_xsd.nistschema_sv_iv_atomic_any_uri_enumeration_5 import (
NistschemaSvIvAtomicAnyUriEnumeration5,
NistschemaSvIvAtomicAnyUriEnumeration5Type,
)
__all__ = [
"NistschemaSvIvAtomicAnyUriEnumeration5",
... | true | true |
1c4acc8d126515aa4dd30b64e9be465fd5ab13b8 | 2,237 | py | Python | examples/github/features/test_github_search.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | examples/github/features/test_github_search.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | examples/github/features/test_github_search.py | Z-Brueske/screenpy | 1c852a49eb3821727662458fd707b9bcf48bb8cf | [
"MIT"
] | null | null | null | """
An example of a test module that follows the typical pytest test
structure. These tests show off how to use custom tasks and questions,
though they are a little bit contrived.
"""
from typing import Generator
import pytest
from screenpy import Actor, AnActor, given, then, when
from screenpy.abilities import Brow... | 34.953125 | 75 | 0.753688 |
from typing import Generator
import pytest
from screenpy import Actor, AnActor, given, then, when
from screenpy.abilities import BrowseTheWeb
from screenpy.actions import Open
from screenpy.pacing import act, scene
from screenpy.resolutions import (
ContainsTheText,
ContainTheText,
DoesNot,
IsEqualTo... | true | true |
1c4ace0ee97cb02a09668b10170665e6f09dee51 | 618 | py | Python | examples/animations/recursive_composite.py | goodhertz/coldtype | 2460b66abb28e9532f9e2b55167ae565f95366e7 | [
"Apache-2.0"
] | 142 | 2020-06-12T17:01:58.000Z | 2022-03-16T23:21:37.000Z | examples/animations/recursive_composite.py | goodhertz/coldtype | 2460b66abb28e9532f9e2b55167ae565f95366e7 | [
"Apache-2.0"
] | 35 | 2020-04-15T15:34:54.000Z | 2022-03-19T20:26:47.000Z | examples/animations/recursive_composite.py | goodhertz/coldtype | 2460b66abb28e9532f9e2b55167ae565f95366e7 | [
"Apache-2.0"
] | 14 | 2020-06-23T18:56:46.000Z | 2022-03-31T15:54:56.000Z | from coldtype import *
from coldtype.fx.skia import fill, phototype
@animation((1080, 1080), timeline=90, composites=1)
def recursive_composite(f):
return (DPS([
f.last_render(lambda p: p
.translate(1, -2)
.scale(0.997)
.ch(fill(1))),
(DP(Rect(200, 200))
... | 34.333333 | 60 | 0.511327 | from coldtype import *
from coldtype.fx.skia import fill, phototype
@animation((1080, 1080), timeline=90, composites=1)
def recursive_composite(f):
return (DPS([
f.last_render(lambda p: p
.translate(1, -2)
.scale(0.997)
.ch(fill(1))),
(DP(Rect(200, 200))
... | true | true |
1c4aceb4e5772df987ce568ec6025ed09d9c93df | 134 | py | Python | src/softfab/docs/reference/__init__.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | 20 | 2019-02-07T17:03:04.000Z | 2020-03-16T20:45:19.000Z | src/softfab/docs/reference/__init__.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | 36 | 2019-02-11T08:57:16.000Z | 2020-09-29T05:32:08.000Z | src/softfab/docs/reference/__init__.py | boxingbeetle/softfab | 0ecf899f66a1fb046ee869cbfa3b5374b3f8aa14 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
button = 'Reference'
children = ('api', 'cmdline', 'releases', 'wrappers')
icon = 'IconDocs'
| 22.333333 | 53 | 0.686567 |
button = 'Reference'
children = ('api', 'cmdline', 'releases', 'wrappers')
icon = 'IconDocs'
| true | true |
1c4acfb5c08ee98c29bfec3501371498e2d86cb2 | 4,508 | py | Python | eggs/Paste-1.7.5.1-py2.7.egg/paste/cascade.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | eggs/Paste-1.7.5.1-py2.7.egg/paste/cascade.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | 1 | 2018-01-03T15:26:49.000Z | 2018-01-03T15:26:49.000Z | eggs/Paste-1.7.5.1-py2.7.egg/paste/cascade.py | salayhin/talkofacta | 8b5a14245dd467bb1fda75423074c4840bd69fb7 | [
"MIT"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Cascades through several applications, so long as applications
return ``404 Not Found``.
"""
from paste import httpexceptions
from paste.util impo... | 33.641791 | 84 | 0.538598 |
"""
Cascades through several applications, so long as applications
return ``404 Not Found``.
"""
from paste import httpexceptions
from paste.util import converters
import tempfile
from cStringIO import StringIO
__all__ = ['Cascade']
def make_cascade(loader, global_conf, catch='404', **local_conf):
"""
Entr... | false | true |
1c4acfe937c7a3c496387cf35b341673a39ff740 | 2,239 | py | Python | compressible_sr/problems/rt.py | zooechiu/pyro2 | 51874476e9c3c3c412c66850ab819ca70af0b20c | [
"BSD-3-Clause"
] | 151 | 2018-08-14T12:52:22.000Z | 2022-03-29T07:57:01.000Z | compressible_sr/problems/rt.py | gfjykldd/pyro2 | b0ca4aa7b1b0f0d445c6a8d0ab63fcc0bc8a431c | [
"BSD-3-Clause"
] | 40 | 2015-03-25T15:45:44.000Z | 2018-07-30T18:48:47.000Z | compressible_sr/problems/rt.py | gfjykldd/pyro2 | b0ca4aa7b1b0f0d445c6a8d0ab63fcc0bc8a431c | [
"BSD-3-Clause"
] | 56 | 2018-10-10T16:54:59.000Z | 2022-02-06T08:48:52.000Z | from __future__ import print_function
import numpy as np
import sys
import mesh.patch as patch
import compressible_sr.eos as eos
from util import msg
def init_data(my_data, rp):
""" initialize the rt problem """
msg.bold("initializing the rt problem...")
# make sure that we are passed a valid patch ob... | 26.341176 | 105 | 0.564538 | from __future__ import print_function
import numpy as np
import sys
import mesh.patch as patch
import compressible_sr.eos as eos
from util import msg
def init_data(my_data, rp):
msg.bold("initializing the rt problem...")
if not isinstance(my_data, patch.CellCenterData2d):
print("ERROR: patch ... | true | true |
1c4ad12ed636214868ae564499c2f27c7c5eb010 | 4,523 | py | Python | devresources/settings.py | Sachin-chaurasiya/devresources | a1aaee1d62b755483ff533bb07ed344a1a155a1f | [
"MIT"
] | null | null | null | devresources/settings.py | Sachin-chaurasiya/devresources | a1aaee1d62b755483ff533bb07ed344a1a155a1f | [
"MIT"
] | null | null | null | devresources/settings.py | Sachin-chaurasiya/devresources | a1aaee1d62b755483ff533bb07ed344a1a155a1f | [
"MIT"
] | null | null | null | """
Django settings for devresources project.
Generated by 'django-admin startproject' using Django 3.1.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
import o... | 25.994253 | 91 | 0.683617 | import os
import dotenv
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
dotenv_file = os.path.join(BASE_DIR, ".env")
if os.path.isfile(dotenv_file):
dotenv.load_dotenv(dotenv_file)
SECRET_KEY = os.environ["SECRET_KEY"]
DEBUG = os.environ.get("DEBUG", False)
ALLOWED_HOSTS = ["l... | true | true |
1c4ad283daf0722e256ef228e2048c6cc80b222e | 1,485 | py | Python | new_package/seed/rename_sync_file.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | new_package/seed/rename_sync_file.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | new_package/seed/rename_sync_file.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | """
rename generated sync asdf file based on the cmt solution files. (relocation)
"""
import subprocess
import click
import obspy
from os.path import join
from glob import glob
def rename_single(mapper, filepath):
# filename = filepath.split("/")[-1]
# filename_new = mapper[filename]
# filepath_new = join... | 30.306122 | 86 | 0.657239 | import subprocess
import click
import obspy
from os.path import join
from glob import glob
def rename_single(mapper, filepath):
filename = filepath.split("/")[-1]
key = filename.split(".")[0].split("_")[1]
key_new = mapper[key]
all_split = filename.split(".")[0].split("_")
all_split... | true | true |
1c4ad3f0fe7fc064e5ce1cba97d6cff0cee2f20b | 10,251 | py | Python | handlers/song.py | Bluehatcoders/Telegram_Vc_Bot | ba9605084275d0a6ec266407e54df5a4cacc5e86 | [
"Apache-2.0"
] | null | null | null | handlers/song.py | Bluehatcoders/Telegram_Vc_Bot | ba9605084275d0a6ec266407e54df5a4cacc5e86 | [
"Apache-2.0"
] | null | null | null | handlers/song.py | Bluehatcoders/Telegram_Vc_Bot | ba9605084275d0a6ec266407e54df5a4cacc5e86 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import os
import requests
import aiohttp
import youtube_dl
import wget
import math
from pyrogram import filters, Client
from youtube_search import YoutubeSearch
from urllib.parse import urlparse
import aiofiles
import os
from random import randint
from youtubesearchpython import ... | 32.961415 | 342 | 0.586674 | from __future__ import unicode_literals
import os
import requests
import aiohttp
import youtube_dl
import wget
import math
from pyrogram import filters, Client
from youtube_search import YoutubeSearch
from urllib.parse import urlparse
import aiofiles
import os
from random import randint
from youtubesearchpython import ... | true | true |
1c4ad4ad9b8231fd18565220e4311acfb7bcd546 | 2,634 | py | Python | visualisations/linear_regression.py | SaadChaouki/ml-eli5-cli5 | 625a69edadf4737e41c58193873cf8a54273d7f0 | [
"MIT"
] | 1 | 2021-05-04T19:53:12.000Z | 2021-05-04T19:53:12.000Z | visualisations/linear_regression.py | SaadChaouki/ml-eli5-cli5 | 625a69edadf4737e41c58193873cf8a54273d7f0 | [
"MIT"
] | null | null | null | visualisations/linear_regression.py | SaadChaouki/ml-eli5-cli5 | 625a69edadf4737e41c58193873cf8a54273d7f0 | [
"MIT"
] | null | null | null | from supervised.regression.linearRegression import LinearRegression
from visualisations.color_palette import two_colors
from deep_learning.loss import MSELoss
from sklearn.model_selection import train_test_split
from sklearn.datasets import make_regression
from matplotlib.animation import FuncAnimation
import matplot... | 36.583333 | 107 | 0.714503 | from supervised.regression.linearRegression import LinearRegression
from visualisations.color_palette import two_colors
from deep_learning.loss import MSELoss
from sklearn.model_selection import train_test_split
from sklearn.datasets import make_regression
from matplotlib.animation import FuncAnimation
import matplot... | true | true |
1c4ad4b41b0454140375984125d9d65161765ca1 | 1,711 | py | Python | oeml-sdk/python/test/test_order_cancel_all_request.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | 1 | 2020-07-23T05:47:52.000Z | 2020-07-23T05:47:52.000Z | oeml-sdk/python/test/test_order_cancel_all_request.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | null | null | null | oeml-sdk/python/test/test_order_cancel_all_request.py | oskaralfons/coinapi-sdk | 2c79b6d91d0f702040dd865e79f0774a4bba9bb3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
OEML - REST API
This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> # noqa: E501
The version... | 31.109091 | 261 | 0.687902 |
from __future__ import absolute_import
import unittest
import datetime
import openapi_client
from openapi_client.models.order_cancel_all_request import OrderCancelAllRequest
from openapi_client.rest import ApiException
class TestOrderCancelAllRequest(unittest.TestCase):
def setUp(self):
pass
... | true | true |
1c4ad4df6ff6671740e265a9a52975b025f45096 | 7,383 | py | Python | userbot/__init__.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-04-09T01:11:33.000Z | 2020-04-09T01:11:33.000Z | userbot/__init__.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/__init__.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot initialization. """
import os
from sys import version_info
from logging import basicConfig, getLogger, IN... | 32.240175 | 143 | 0.720439 |
import os
from sys import version_info
from logging import basicConfig, getLogger, INFO, DEBUG
from distutils.util import strtobool as sb
from pylast import LastFMNetwork, md5
from pySmartDL import SmartDL
from dotenv import load_dotenv
from requests import get
from telethon import TelegramClient
from telethon.... | true | true |
1c4ad6f2ead8fd5590dda5ddff82e834af7eaa24 | 1,825 | py | Python | decrypt.py | tjmovie/psse-decrypt | f2c8f09738185766f8b04253f79f627ae433de7a | [
"Unlicense"
] | null | null | null | decrypt.py | tjmovie/psse-decrypt | f2c8f09738185766f8b04253f79f627ae433de7a | [
"Unlicense"
] | null | null | null | decrypt.py | tjmovie/psse-decrypt | f2c8f09738185766f8b04253f79f627ae433de7a | [
"Unlicense"
] | null | null | null | import os
import binascii
import sys
from Crypto.Cipher import AES
game_key = b""
def ReadGameKey(filename):
global game_key
riffd = open(filename, "rb")
riffd.seek(0x120)
game_key = riffd.read(0x10)
riffd.close()
def DecryptFile(filename):
fd = open(filename, "rb")
header =... | 29.435484 | 85 | 0.610411 | import os
import binascii
import sys
from Crypto.Cipher import AES
game_key = b""
def ReadGameKey(filename):
global game_key
riffd = open(filename, "rb")
riffd.seek(0x120)
game_key = riffd.read(0x10)
riffd.close()
def DecryptFile(filename):
fd = open(filename, "rb")
header =... | true | true |
1c4ad74c2747e25780643d5004eefc4b2adda9e9 | 8,693 | py | Python | webservice/utils/analyze_buildLog.py | randytli/Paddle-bot | c4dc7044a82047f46d47733ad31c10eab0417b4b | [
"Apache-2.0"
] | 1 | 2020-05-27T05:21:40.000Z | 2020-05-27T05:21:40.000Z | webservice/utils/analyze_buildLog.py | randytli/Paddle-bot | c4dc7044a82047f46d47733ad31c10eab0417b4b | [
"Apache-2.0"
] | null | null | null | webservice/utils/analyze_buildLog.py | randytli/Paddle-bot | c4dc7044a82047f46d47733ad31c10eab0417b4b | [
"Apache-2.0"
] | null | null | null | #coding=utf-8
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from utils.readConfig import ReadConfig
from utils.auth_ipipe import Get_ipipe_auth
from utils.db import Database
from utils import bosclient
import os
import time
import datetime
import logging
from tornado.httpclient... | 43.683417 | 117 | 0.644081 |
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from utils.readConfig import ReadConfig
from utils.auth_ipipe import Get_ipipe_auth
from utils.db import Database
from utils import bosclient
import os
import time
import datetime
import logging
from tornado.httpclient import Async... | true | true |
1c4ad7bb528c874b879b1da41e20cceb700b3a0a | 3,651 | py | Python | mmfewshot/detection/models/roi_heads/bbox_heads/meta_bbox_head.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 376 | 2021-11-23T13:29:57.000Z | 2022-03-30T07:22:14.000Z | mmfewshot/detection/models/roi_heads/bbox_heads/meta_bbox_head.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 51 | 2021-11-23T14:45:08.000Z | 2022-03-30T03:37:15.000Z | mmfewshot/detection/models/roi_heads/bbox_heads/meta_bbox_head.py | BIGWangYuDong/mmfewshot | dac097afc92df176bc2de76b7c90968584865197 | [
"Apache-2.0"
] | 56 | 2021-11-23T14:02:27.000Z | 2022-03-31T09:01:50.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import copy
from typing import Dict, Optional
import torch
import torch.nn as nn
from mmcv.runner import force_fp32
from mmdet.models.builder import HEADS, build_loss
from mmdet.models.losses import accuracy
from mmdet.models.roi_heads import BBoxHead
from torch import T... | 38.431579 | 76 | 0.612435 |
import copy
from typing import Dict, Optional
import torch
import torch.nn as nn
from mmcv.runner import force_fp32
from mmdet.models.builder import HEADS, build_loss
from mmdet.models.losses import accuracy
from mmdet.models.roi_heads import BBoxHead
from torch import Tensor
@HEADS.register_module()
class MetaBBox... | true | true |
1c4ada067ccaae4dfb745c521b71812b9ecd0997 | 81,491 | py | Python | imjoy_elfinder/elfinder.py | oeway/jupyter_elfinder | e89eb535b6bdc9024a1af57ecc67056ce9b5a94f | [
"MIT"
] | null | null | null | imjoy_elfinder/elfinder.py | oeway/jupyter_elfinder | e89eb535b6bdc9024a1af57ecc67056ce9b5a94f | [
"MIT"
] | null | null | null | imjoy_elfinder/elfinder.py | oeway/jupyter_elfinder | e89eb535b6bdc9024a1af57ecc67056ce9b5a94f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Connector for elFinder File Manager
# Original author Troex Nevelin <troex@fury.scancode.ru>
# Modified by Svintsov Dmitry (https://github.com/uralbash)
# Further adapted by ImJoy Team (https://github.com/imjoy-team)
# License: 3-clauses BSD license
"""Provide the connector for elFinder File ... | 33.898087 | 88 | 0.504473 |
import base64
import hashlib
import mimetypes
import os
import re
import shlex
import shutil
import subprocess
import time
import traceback
import uuid
from datetime import datetime
from types import ModuleType
from typing import Any, BinaryIO, Dict, Generator, List, Optional, Tuple, Union
from urllib.parse im... | true | true |
1c4adaf952402e4e01c0172f18132c0bfdaf4075 | 4,308 | py | Python | tethys_portal/urls.py | quyendong/tethys | 99bcb524d5b2021b88d5fa15b7ed6b8acb460997 | [
"BSD-2-Clause"
] | 1 | 2020-10-08T20:38:33.000Z | 2020-10-08T20:38:33.000Z | tethys_portal/urls.py | quyendong/tethys | 99bcb524d5b2021b88d5fa15b7ed6b8acb460997 | [
"BSD-2-Clause"
] | 1 | 2018-04-14T19:40:54.000Z | 2018-04-14T19:40:54.000Z | tethys_portal/urls.py | quyendong/tethys | 99bcb524d5b2021b88d5fa15b7ed6b8acb460997 | [
"BSD-2-Clause"
] | 1 | 2021-09-07T14:47:11.000Z | 2021-09-07T14:47:11.000Z | """
********************************************************************************
* Name: urls.py
* Author: Nathan Swain
* Created On: 2014
* Copyright: (c) Brigham Young University 2014
* License: BSD 2-Clause
********************************************************************************
"""
from django.conf.urls... | 48.954545 | 115 | 0.694754 | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.views import password_reset, password_reset_done, password_reset_confirm, \
password_reset_complete
from django.conf import settings
from tethys_apps.urls import extension_urls
from tethys_portal.views import accoun... | true | true |
1c4adc3e1414a627a27ad7d8b9a75d4ab2509e2d | 4,973 | py | Python | plugins/rapid7_intsights/icon_rapid7_intsights/actions/get_alerts/schema.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | plugins/rapid7_intsights/icon_rapid7_intsights/actions/get_alerts/schema.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | plugins/rapid7_intsights/icon_rapid7_intsights/actions/get_alerts/schema.py | blaxminarayan-r7/insightconnect-plugins | a3963eb3d3d7432d07bd46a5641700bd0ba6e11e | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Search alerts based on criteria"
class Input:
ALERT_TYPE = "alert_type"
ASSIGNED = "assigned"
FOUND_DATE_FROM = "found_date_from"
FOUND_DATE_TO = "found_date_to"
HAS_INDIC... | 27.174863 | 524 | 0.580736 |
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Search alerts based on criteria"
class Input:
ALERT_TYPE = "alert_type"
ASSIGNED = "assigned"
FOUND_DATE_FROM = "found_date_from"
FOUND_DATE_TO = "found_date_to"
HAS_INDICATORS = "has_indicators"
IS_CLOSED ... | true | true |
1c4adc4be002dfe987da7b17651e87a0b87e7162 | 390 | py | Python | look/urls.py | scotthou94/myinstagram | 7313c89aa38e70c7c4f9b8969d699f850145afca | [
"MIT"
] | null | null | null | look/urls.py | scotthou94/myinstagram | 7313c89aa38e70c7c4f9b8969d699f850145afca | [
"MIT"
] | null | null | null | look/urls.py | scotthou94/myinstagram | 7313c89aa38e70c7c4f9b8969d699f850145afca | [
"MIT"
] | null | null | null | from django.conf.urls import url,include
from . import views
from django.contrib.auth.decorators import login_required
urlpatterns = [
url(r'^$', views.index),
url(r'^discover/', login_required(views.discover)),
url(r'^follow/$', login_required(views.follow), name='follow'),
url(r'^unfollow/(?P<ta... | 32.5 | 90 | 0.694872 | from django.conf.urls import url,include
from . import views
from django.contrib.auth.decorators import login_required
urlpatterns = [
url(r'^$', views.index),
url(r'^discover/', login_required(views.discover)),
url(r'^follow/$', login_required(views.follow), name='follow'),
url(r'^unfollow/(?P<ta... | true | true |
1c4adcf7e64b4d92e082b9ba0e6857c359ce8ed3 | 115 | py | Python | ex030.py | Roninho514/Treinamento-Python | fc6ad0b64fb3dc3cfa5381f8fc53b5b3243a7ff6 | [
"MIT"
] | null | null | null | ex030.py | Roninho514/Treinamento-Python | fc6ad0b64fb3dc3cfa5381f8fc53b5b3243a7ff6 | [
"MIT"
] | null | null | null | ex030.py | Roninho514/Treinamento-Python | fc6ad0b64fb3dc3cfa5381f8fc53b5b3243a7ff6 | [
"MIT"
] | null | null | null | numero = int(input('Digite um número:'))
print('Esse número é par' if numero % 2 == 0 else 'Esse número é impa7r')
| 38.333333 | 73 | 0.678261 | numero = int(input('Digite um número:'))
print('Esse número é par' if numero % 2 == 0 else 'Esse número é impa7r')
| true | true |
1c4adda868e850063084c445480ede3817802d12 | 93,297 | py | Python | python/ray/tests/test_basic.py | gaocegege/ray | 03d05c8765bb6cfd30fdbbcd4577dc22c5dc5af7 | [
"Apache-2.0"
] | 1 | 2019-08-21T08:31:10.000Z | 2019-08-21T08:31:10.000Z | python/ray/tests/test_basic.py | GitAlanWong/ray | c852213b8349b6b9e9e7353573e2259a1b9ef925 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_basic.py | GitAlanWong/ray | c852213b8349b6b9e9e7353573e2259a1b9ef925 | [
"Apache-2.0"
] | 2 | 2019-09-04T13:27:51.000Z | 2019-09-17T04:20:38.000Z | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
from multiprocessing import Process
import os
import random
import re
import setproctitle
import s... | 29.960501 | 79 | 0.60734 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import json
import logging
from multiprocessing import Process
import os
import random
import re
import setproctitle
import shutil
import si... | true | true |
1c4addfb448396b0009dee5101f84c6c363ce2cb | 51,768 | py | Python | pandas/core/indexes/interval.py | Bifaxin/pandas | 2ec7f2f279d770b286c9c7679ba7ad0e2f14dcbe | [
"BSD-3-Clause"
] | 2 | 2019-12-31T14:22:54.000Z | 2019-12-31T14:23:42.000Z | pandas/core/indexes/interval.py | Bifaxin/pandas | 2ec7f2f279d770b286c9c7679ba7ad0e2f14dcbe | [
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/interval.py | Bifaxin/pandas | 2ec7f2f279d770b286c9c7679ba7ad0e2f14dcbe | [
"BSD-3-Clause"
] | null | null | null | """ define the IntervalIndex """
from operator import le, lt
import textwrap
from typing import Any, Optional, Tuple, Union
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import Timedelta, Timestamp, lib
from pandas._libs.interval import Interval, IntervalMixin, IntervalTr... | 33.036375 | 95 | 0.583527 | from operator import le, lt
import textwrap
from typing import Any, Optional, Tuple, Union
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import Timedelta, Timestamp, lib
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
from pandas.util._decorators i... | true | true |
1c4ade2d78bc881c4de7dad09da7fcbf9edec689 | 2,851 | py | Python | auto_generated_scripts/combining_kernels_by_summation.py | myforkmachine/pyprobml | a750b6e33e849ca75300fec1b9ee4b61def80c52 | [
"MIT"
] | null | null | null | auto_generated_scripts/combining_kernels_by_summation.py | myforkmachine/pyprobml | a750b6e33e849ca75300fec1b9ee4b61def80c52 | [
"MIT"
] | null | null | null | auto_generated_scripts/combining_kernels_by_summation.py | myforkmachine/pyprobml | a750b6e33e849ca75300fec1b9ee4b61def80c52 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
try:
import jax
except:
get_ipython().run_line_magic('pip', 'install jax jaxlib')
import jax
import jax.numpy as jnp
try:
import matplotlib.pyplot as plt
except:
get_ipython().run_line_magic('pip', 'install matplotlib')
import matplotlib.pyplot ... | 22.273438 | 64 | 0.619783 |
try:
import jax
except:
get_ipython().run_line_magic('pip', 'install jax jaxlib')
import jax
import jax.numpy as jnp
try:
import matplotlib.pyplot as plt
except:
get_ipython().run_line_magic('pip', 'install matplotlib')
import matplotlib.pyplot as plt
try:
import seaborn as sns
excep... | true | true |
1c4adea1f2919d3e80db315f58aa9cebace16e2d | 2,724 | py | Python | django/db/migrations/recorder.py | bak1an/django | 98bcc5d81bca578f3a5b4d47907ba4ac40446887 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2021-04-14T20:15:54.000Z | 2021-04-14T20:15:54.000Z | django/db/migrations/recorder.py | djk2/django | 6b00af50146335485d8414c42efec7d8dd5397fc | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/migrations/recorder.py | djk2/django | 6b00af50146335485d8414c42efec7d8dd5397fc | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-02-06T10:31:51.000Z | 2020-02-06T10:31:51.000Z | from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
class MigrationRecorder:
"""
Deals with storing migration records in the database.
Because this table is actua... | 32.819277 | 112 | 0.646843 | from django.apps.registry import Apps
from django.db import models
from django.db.utils import DatabaseError
from django.utils.timezone import now
from .exceptions import MigrationSchemaMissing
class MigrationRecorder:
class Migration(models.Model):
app = models.CharField(max_length=255)
name = ... | true | true |
1c4adf74fe56fbacc2ac8f5384028ec5a33fdee6 | 1,138 | py | Python | flocker/node/test/test_testtools.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/node/test/test_testtools.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | flocker/node/test/test_testtools.py | wallnerryan/flocker-profiles | bcd3ced8edf4af86a68070ff6a714c45f9f4913b | [
"Apache-2.0"
] | null | null | null | # Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Tests for ``flocker.node.testtools``.
"""
from zope.interface import implementer
from twisted.internet.defer import succeed
from .. import sequentially
from ..testtools import (
DummyDeployer, ControllableDeployer, ideployer_tests_factory,
)
from ...... | 24.212766 | 68 | 0.702988 |
from zope.interface import implementer
from twisted.internet.defer import succeed
from .. import sequentially
from ..testtools import (
DummyDeployer, ControllableDeployer, ideployer_tests_factory,
)
from ...control import IClusterStateChange
@implementer(IClusterStateChange)
class DummyClusterStateChange(ob... | true | true |
1c4ae2fc6e24edd3378f495b4123ca7ea576606a | 467 | py | Python | src/python/pants/option/errors.py | hythloday/pants | 107e9b0957f6949ac4bd535fbef8d2d8cba05c5c | [
"Apache-2.0"
] | 11 | 2015-01-20T01:39:41.000Z | 2019-08-08T07:27:44.000Z | src/python/pants/option/errors.py | hythloday/pants | 107e9b0957f6949ac4bd535fbef8d2d8cba05c5c | [
"Apache-2.0"
] | 1 | 2019-08-21T07:29:26.000Z | 2019-08-21T07:29:26.000Z | src/python/pants/option/errors.py | fakeNetflix/square-repo-pants | 28a018c7f47900aec4f576c81a52e0e4b41d9fec | [
"Apache-2.0"
] | 5 | 2015-03-30T02:46:53.000Z | 2018-03-08T20:10:43.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
class RegistrationE... | 27.470588 | 93 | 0.728051 |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
class RegistrationError(Exception):
pass
class ParseError(Exception):
pass
| true | true |
1c4ae411c24d29c5748c1368f010a592d04efd84 | 2,532 | py | Python | test_database.py | rr2674/item_catalog | df424d45cb5be9399cd671607e63a99b810c934c | [
"MIT"
] | null | null | null | test_database.py | rr2674/item_catalog | df424d45cb5be9399cd671607e63a99b810c934c | [
"MIT"
] | null | null | null | test_database.py | rr2674/item_catalog | df424d45cb5be9399cd671607e63a99b810c934c | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
from sqlalchemy import create_engine, asc
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Category, Item, User
engine = create_engine('sqlite:///assignment4.db')
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
#q = session.quer... | 30.506024 | 130 | 0.675355 |
from sqlalchemy import create_engine, asc
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Category, Item, User
engine = create_engine('sqlite:///assignment4.db')
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
users = [
('Bob Whatever', '', ... | false | true |
1c4ae493f041362e778734f35d7f5208e5ae65ed | 5,189 | py | Python | tensorflow/python/distribute/keras_metrics_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/keras_metrics_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/keras_metrics_test.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 39.015038 | 81 | 0.624976 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.distribute import combinations
from tensorflow.python.distribute import stra... | true | true |
1c4ae526ae0a32d9da7ee7d70f206beb11de142a | 8,242 | py | Python | lib/fast_rcnn/test_gallery.py | yellowstarhx/person_search | e36a3d9db5d4b21ff29a9618b4e5f818c8f35300 | [
"BSD-2-Clause"
] | 768 | 2016-04-09T15:09:57.000Z | 2022-03-21T06:05:49.000Z | lib/fast_rcnn/test_gallery.py | IvyYZ/person_search | e36a3d9db5d4b21ff29a9618b4e5f818c8f35300 | [
"BSD-2-Clause"
] | 130 | 2016-05-24T08:00:04.000Z | 2022-03-24T18:40:31.000Z | lib/fast_rcnn/test_gallery.py | IvyYZ/person_search | e36a3d9db5d4b21ff29a9618b4e5f818c8f35300 | [
"BSD-2-Clause"
] | 264 | 2016-05-08T16:01:42.000Z | 2022-03-06T11:39:11.000Z | import numpy as np
import cv2
from fast_rcnn.config import cfg
from fast_rcnn.bbox_transform import clip_boxes, bbox_transform_inv
from fast_rcnn.nms_wrapper import nms
from fast_rcnn.test_utils import get_image_blob, get_gt_boxes_blob
from fast_rcnn.test_probe import _im_exfeat
from utils.timer import Timer
def _im... | 35.991266 | 80 | 0.599248 | import numpy as np
import cv2
from fast_rcnn.config import cfg
from fast_rcnn.bbox_transform import clip_boxes, bbox_transform_inv
from fast_rcnn.nms_wrapper import nms
from fast_rcnn.test_utils import get_image_blob, get_gt_boxes_blob
from fast_rcnn.test_probe import _im_exfeat
from utils.timer import Timer
def _im... | false | true |
1c4ae56e29fb675a37300f165e75394c050cee69 | 108 | py | Python | openstack_manager/conf/constant.py | syunkitada/openstack-manager | d37c611040444352d3947f236f04124e4f548390 | [
"MIT"
] | null | null | null | openstack_manager/conf/constant.py | syunkitada/openstack-manager | d37c611040444352d3947f236f04124e4f548390 | [
"MIT"
] | null | null | null | openstack_manager/conf/constant.py | syunkitada/openstack-manager | d37c611040444352d3947f236f04124e4f548390 | [
"MIT"
] | null | null | null | # coding: utf-8
INIFILE = '/etc/openstack_manager/openstack_manager.conf'
LOG_DOMEIN = 'openstack_manager'
| 21.6 | 57 | 0.787037 |
INIFILE = '/etc/openstack_manager/openstack_manager.conf'
LOG_DOMEIN = 'openstack_manager'
| true | true |
1c4ae5b4e8da20e6eed7f5cfb053c8127923859c | 1,815 | py | Python | experiments/joystick.py | joc-mer/py-tetris-esp32 | cde188b97ebf4f339ff8826ef802d3771a7c952c | [
"BSD-3-Clause"
] | null | null | null | experiments/joystick.py | joc-mer/py-tetris-esp32 | cde188b97ebf4f339ff8826ef802d3771a7c952c | [
"BSD-3-Clause"
] | null | null | null | experiments/joystick.py | joc-mer/py-tetris-esp32 | cde188b97ebf4f339ff8826ef802d3771a7c952c | [
"BSD-3-Clause"
] | null | null | null | from machine import ADC, Pin, SPI
import utime, math
import max7219 # https://github.com/mcauser/micropython-max7219
# ESP32 max7219 8x8 LED Matrix
# 5V VCC
# GND GND
# D2 DIN
# D5 CS
# D4 CLK
# -- set up 8 pix matrices of 8x8 LED (monochrome)
spi = SPI(1, baudrate=10000000, polarity=1, phase=0, sck=P... | 24.527027 | 105 | 0.603857 | from machine import ADC, Pin, SPI
import utime, math
import max7219
spi = SPI(1, baudrate=10000000, polarity=1, phase=0, sck=Pin(4), mosi=Pin(2))
ss = Pin(5, Pin.OUT)
display = max7219.Matrix8x8(spi, ss, 4)
display.fill(0)
display.show()
xPin, yPin, cPin = 34, 32, 27
H_9BIT, 10:ADC.WIDTH_10BIT,
... | true | true |
1c4ae77477d8d3e5166dcacf0aee93a91c200ce5 | 31,826 | py | Python | src/contractExtractor/reentrancyExtractor/judgePath.py | xf97/HuangGai | 40a349be6102d5eb63893fb914659405ae162d93 | [
"MIT"
] | 23 | 2020-09-20T02:10:44.000Z | 2022-03-22T12:58:13.000Z | src/contractExtractor/reentrancyExtractor/judgePath.py | xf97/HuangGai | 40a349be6102d5eb63893fb914659405ae162d93 | [
"MIT"
] | 3 | 2020-09-22T15:28:33.000Z | 2022-01-22T07:48:53.000Z | src/contractExtractor/reentrancyExtractor/judgePath.py | xf97/HuangGai | 40a349be6102d5eb63893fb914659405ae162d93 | [
"MIT"
] | 5 | 2021-07-15T02:45:09.000Z | 2022-03-21T13:36:40.000Z | #!/usr/bin/python
#-*- coding: utf-8 -*-
'''
该部分程序用于判断目标合约是否包含目标路径
如果包含,则需要保存目标路径
'''
'''
可用工具:slither真是个宝藏工具
slither可能可用的功能:
合约各个函数的调用图
文件中各个合约的继承关系
最子类合约的构造函数执行结果
function-summary里有每个函数读写、内外部调用的总结
human-summary里有对每个合约功能的概述->可以用来判断->不能用来判断,对于Receive ETH而言,只判断payable关键字而不判断合约是否真的可以接收以太币
require显示出每个合约的每个函数中用到的requir... | 32.115035 | 153 | 0.68532 |
import subprocess
import os
from inherGraph import inherGraph
from colorPrint import *
from pydot import io
import re
import json
CACHE_PATH = "./cache/"
TERMINAL_FILE = "log.txt"
INJECT_INFO_PATH = "./result/"
TUPLE_FLAG = "tuple()"
REQUIRE_FUNC_TYPE_FLAG = "function (bool) pure"
REQUIRE_FUNC_STRING_TY... | true | true |
1c4ae85a0d8d9e82d0383f1b99a36ec9586665d4 | 8,662 | py | Python | homeassistant/components/xiaomi_miio/remote.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 1 | 2019-02-18T03:16:32.000Z | 2019-02-18T03:16:32.000Z | homeassistant/components/xiaomi_miio/remote.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:29:36.000Z | 2022-03-12T00:59:48.000Z | homeassistant/components/xiaomi_miio/remote.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 1 | 2019-09-28T07:06:08.000Z | 2019-09-28T07:06:08.000Z | """Support for the Xiaomi IR Remote (Chuangmi IR)."""
import asyncio
import logging
import time
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.remote import (
PLATFORM_SCHEMA, DOMAIN, ATTR_NUM_REPEATS, ATTR_DELAY_SECS,
DEFAULT_DELAY_SECS, RemoteDevice)
from homeassistan... | 33.187739 | 79 | 0.625491 | import asyncio
import logging
import time
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.remote import (
PLATFORM_SCHEMA, DOMAIN, ATTR_NUM_REPEATS, ATTR_DELAY_SECS,
DEFAULT_DELAY_SECS, RemoteDevice)
from homeassistant.const import (
CONF_NAME, CONF_HOST, CONF_TOKEN,... | true | true |
1c4ae8c514ee7ef6422e7f7a69e4e366db683d91 | 6,151 | py | Python | conditional/util/member.py | jabbate19/conditional | 20013459438d80bca06a844da250e2543c84186e | [
"MIT"
] | 9 | 2016-08-21T19:27:24.000Z | 2019-09-12T06:56:49.000Z | conditional/util/member.py | jabbate19/conditional | 20013459438d80bca06a844da250e2543c84186e | [
"MIT"
] | 237 | 2016-08-21T18:08:58.000Z | 2022-03-28T17:01:36.000Z | conditional/util/member.py | jabbate19/conditional | 20013459438d80bca06a844da250e2543c84186e | [
"MIT"
] | 31 | 2016-08-22T23:46:48.000Z | 2022-03-26T22:37:39.000Z | from datetime import datetime
from conditional import start_of_year
from conditional.models.models import CommitteeMeeting
from conditional.models.models import CurrentCoops
from conditional.models.models import FreshmanEvalData
from conditional.models.models import HouseMeeting
from conditional.models.models import M... | 37.969136 | 98 | 0.688506 | from datetime import datetime
from conditional import start_of_year
from conditional.models.models import CommitteeMeeting
from conditional.models.models import CurrentCoops
from conditional.models.models import FreshmanEvalData
from conditional.models.models import HouseMeeting
from conditional.models.models import M... | true | true |
1c4aea51c99be63d27dd8fd9ab6ca5dbffa66cae | 176,012 | py | Python | galois/_fields/_main.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | galois/_fields/_main.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | galois/_fields/_main.py | iyanmv/galois | a5e6386a684e3e0b47af608217002795dc25c702 | [
"MIT"
] | null | null | null | """
A module that contains the main classes for Galois fields -- FieldClass, FieldArray,
and Poly. They're all in one file because they have circular dependencies. The specific GF2
FieldClass is also included.
"""
import inspect
import math
import random
from typing import Tuple, List, Sequence, Iterable, Optional, Uni... | 36.845719 | 428 | 0.55853 | import inspect
import math
import random
from typing import Tuple, List, Sequence, Iterable, Optional, Union
from typing_extensions import Literal
import numba
import numpy as np
from .._factor import divisors
from .._overrides import set_module
from .._poly_conversion import integer_to_poly, poly_to_integer, str_to_... | true | true |
1c4aea5dca4be7bf3e49a80f9d93695e5aff40c9 | 8,347 | py | Python | cwmud/contrib/worldgen/terrain.py | whutch/cwmud | bee8b126a5e70edd0593dae9753a6be8d52357cf | [
"MIT"
] | 11 | 2016-03-03T03:56:59.000Z | 2021-11-19T15:38:51.000Z | cwmud/contrib/worldgen/terrain.py | whutch/atria | bee8b126a5e70edd0593dae9753a6be8d52357cf | [
"MIT"
] | 26 | 2016-08-31T23:19:45.000Z | 2019-10-19T21:50:33.000Z | cwmud/contrib/worldgen/terrain.py | whutch/atria | bee8b126a5e70edd0593dae9753a6be8d52357cf | [
"MIT"
] | 2 | 2016-01-22T21:22:34.000Z | 2016-02-09T06:03:57.000Z | # -*- coding: utf-8 -*-
"""Terrain types and management."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 Will Hutcheson
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
from os.path import dirname, exists, join
from ...core.attributes import U... | 36.933628 | 77 | 0.623697 |
from os.path import dirname, exists, join
from ...core.attributes import Unset
from ...core.entities import Attribute
from ...core.logs import get_logger
from ...core.utils.exceptions import AlreadyExists
from ...core.world import Room
log = get_logger("worldgen")
class TerrainManager:
def __init__(self... | true | true |
1c4aeb13d345d58019753e98b9a30dd9ea37b2fd | 3,440 | py | Python | src/wallabag/wallabag_show.py | davidhelbig/wallabag-cli | 0324138593c836e7371450262c14f207445bb921 | [
"MIT"
] | 3 | 2020-04-22T05:08:49.000Z | 2020-07-30T18:43:10.000Z | src/wallabag/wallabag_show.py | davidhelbig/wallabag-cli | 0324138593c836e7371450262c14f207445bb921 | [
"MIT"
] | null | null | null | src/wallabag/wallabag_show.py | davidhelbig/wallabag-cli | 0324138593c836e7371450262c14f207445bb921 | [
"MIT"
] | 3 | 2020-04-23T18:30:04.000Z | 2020-10-14T14:57:59.000Z | """
Show a wallabag entry
"""
import io
import formatter
import json
import os
from sys import exit
import sys
from bs4 import BeautifulSoup
from . import api
from . import conf
from . import entry
def show(entry_id, colors=True, raw=False, html=False):
"""
Main function for showing an entry.
"""
con... | 26.461538 | 98 | 0.581977 | import io
import formatter
import json
import os
from sys import exit
import sys
from bs4 import BeautifulSoup
from . import api
from . import conf
from . import entry
def show(entry_id, colors=True, raw=False, html=False):
conf.load()
try:
request = api.api_get_entry(entry_id)
__handle_reque... | true | true |
1c4aec00bc23d2f212b4cd3654c3fd79517543b8 | 1,672 | py | Python | tests/cpu/test_layer_norm.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | 322 | 2020-05-08T04:03:51.000Z | 2022-03-30T13:01:31.000Z | tests/cpu/test_layer_norm.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | 159 | 2020-05-09T02:55:40.000Z | 2022-03-30T13:43:04.000Z | tests/cpu/test_layer_norm.py | Manny27nyc/intel-extension-for-pytorch | b40faedf6b00d520f6483d519d2e82bce0a6c0d1 | [
"Apache-2.0"
] | 64 | 2020-05-08T03:49:27.000Z | 2022-03-22T09:50:23.000Z | import unittest
import torch
import intel_extension_for_pytorch as ipex
from common_utils import TestCase
class M1(torch.nn.Module):
def __init__(self):
super(M1, self).__init__()
self.conv = torch.nn.Conv2d(5, 5, 1, stride=1, bias=False)
self.layer_norm = torch.nn.LayerNorm(10... | 31.54717 | 67 | 0.585526 | import unittest
import torch
import intel_extension_for_pytorch as ipex
from common_utils import TestCase
class M1(torch.nn.Module):
def __init__(self):
super(M1, self).__init__()
self.conv = torch.nn.Conv2d(5, 5, 1, stride=1, bias=False)
self.layer_norm = torch.nn.LayerNorm(10... | true | true |
1c4aec3a579fd4b1fab905c16e68050e23f9625c | 1,087 | py | Python | route/user_count_edit.py | k0000k/openNAMU | b5862a7e5a1f1a2a6bee5eec5b3d9784528f42e8 | [
"BSD-3-Clause"
] | 126 | 2019-01-16T01:02:34.000Z | 2021-07-04T14:16:40.000Z | route/user_count_edit.py | k0000k/openNAMU | b5862a7e5a1f1a2a6bee5eec5b3d9784528f42e8 | [
"BSD-3-Clause"
] | 454 | 2018-12-02T10:03:37.000Z | 2021-07-13T11:31:42.000Z | route/user_count_edit.py | k0000k/openNAMU | b5862a7e5a1f1a2a6bee5eec5b3d9784528f42e8 | [
"BSD-3-Clause"
] | 102 | 2018-12-02T11:49:54.000Z | 2021-06-30T10:52:53.000Z | from .tool.func import *
def user_count_edit_2(conn, name):
curs = conn.cursor()
if name == None:
that = ip_check()
else:
that = name
curs.execute(db_change("select count(*) from history where ip = ?"), [that])
count = curs.fetchall()
if count:
data = count[0][0]
e... | 31.970588 | 151 | 0.50598 | from .tool.func import *
def user_count_edit_2(conn, name):
curs = conn.cursor()
if name == None:
that = ip_check()
else:
that = name
curs.execute(db_change("select count(*) from history where ip = ?"), [that])
count = curs.fetchall()
if count:
data = count[0][0]
e... | true | true |
1c4aecf3ee7f936904e6cbea697a7afb16be293b | 12,649 | py | Python | rebuild_test.py | thobbs/cassandra-dtest | 71c0c31258577033a591abad4bf6fdcfdc9f723b | [
"Apache-2.0"
] | null | null | null | rebuild_test.py | thobbs/cassandra-dtest | 71c0c31258577033a591abad4bf6fdcfdc9f723b | [
"Apache-2.0"
] | null | null | null | rebuild_test.py | thobbs/cassandra-dtest | 71c0c31258577033a591abad4bf6fdcfdc9f723b | [
"Apache-2.0"
] | null | null | null | import time
from threading import Thread
from cassandra import ConsistencyLevel
from ccmlib.node import ToolError
from dtest import Tester, debug
from tools import insert_c1c2, query_c1c2, since
class TestRebuild(Tester):
def __init__(self, *args, **kwargs):
kwargs['cluster_options'] = {'start_rpc': 't... | 43.617241 | 190 | 0.570875 | import time
from threading import Thread
from cassandra import ConsistencyLevel
from ccmlib.node import ToolError
from dtest import Tester, debug
from tools import insert_c1c2, query_c1c2, since
class TestRebuild(Tester):
def __init__(self, *args, **kwargs):
kwargs['cluster_options'] = {'start_rpc': 't... | false | true |
1c4aee0bd841408284417e7a4b3eeb4380477e57 | 5,814 | py | Python | eval.py | Luoyadan/BGNN-AAAI | 16bd260b93009be27932415e74ce1b3128215d92 | [
"MIT"
] | 52 | 2019-12-11T08:25:11.000Z | 2021-12-26T09:32:56.000Z | eval.py | UQMM/BGNN-AAAI | 16bd260b93009be27932415e74ce1b3128215d92 | [
"MIT"
] | 3 | 2020-02-17T03:37:17.000Z | 2021-06-09T09:22:10.000Z | eval.py | UQMM/BGNN-AAAI | 16bd260b93009be27932415e74ce1b3128215d92 | [
"MIT"
] | 16 | 2020-01-15T06:42:30.000Z | 2021-08-30T05:59:43.000Z | import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1"
from torchtools import *
from data import MiniImagenetLoader, TieredImagenetLoader
from model import EmbeddingImagenet, GraphNetwork, ConvNet
import shutil
import os
import random
from train import ModelTrainer
if __name... | 35.668712 | 132 | 0.659615 | import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1"
from torchtools import *
from data import MiniImagenetLoader, TieredImagenetLoader
from model import EmbeddingImagenet, GraphNetwork, ConvNet
import shutil
import os
import random
from train import ModelTrainer
if __name... | true | true |
1c4aee7999da36da005471a52b1815e649767373 | 66,724 | py | Python | feapder/utils/tools.py | gyco/feapder | 6d7f6f318b3dd93168cbd76d9ba165b04285a05e | [
"MIT"
] | null | null | null | feapder/utils/tools.py | gyco/feapder | 6d7f6f318b3dd93168cbd76d9ba165b04285a05e | [
"MIT"
] | null | null | null | feapder/utils/tools.py | gyco/feapder | 6d7f6f318b3dd93168cbd76d9ba165b04285a05e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on 2018-09-06 14:21
---------
@summary: 工具
---------
@author: Boris
@email: boris_liu@foxmail.com
"""
import asyncio
import base64
import calendar
import codecs
import configparser # 读配置文件的
import datetime
import functools
import hashlib
import html
import json
import os
import pick... | 24.795243 | 145 | 0.562601 |
import asyncio
import base64
import calendar
import codecs
import configparser
import datetime
import functools
import hashlib
import html
import json
import os
import pickle
import random
import re
import signal
import socket
import ssl
import string
import sys
import time
import traceback
import urllib
import urll... | true | true |
1c4aeeff8024ba7316b92e3705770ea7212291c0 | 2,664 | py | Python | folklore/log.py | maralla/folklore | 851aded3db130a84d3a9c1bb581cdaad12e5b5a1 | [
"MIT"
] | null | null | null | folklore/log.py | maralla/folklore | 851aded3db130a84d3a9c1bb581cdaad12e5b5a1 | [
"MIT"
] | null | null | null | folklore/log.py | maralla/folklore | 851aded3db130a84d3a9c1bb581cdaad12e5b5a1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
folklore.log
~~~~~~~~~~~~
This module implements log configuration.
Hook definition:
- init_process Config logs
"""
import sys
import logging
import logging.config
from copy import deepcopy
from .hook import define_hook
CONF = {
'version': 1,
'disable_existing_loggers': F... | 23.575221 | 74 | 0.563438 |
import sys
import logging
import logging.config
from copy import deepcopy
from .hook import define_hook
CONF = {
'version': 1,
'disable_existing_loggers': False,
'root': None,
'loggers': {},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHan... | true | true |
1c4aef1e83c2ef8ee4a5a277c50748c34c3b41ea | 6,388 | py | Python | casemgmt/models.py | devmonkey22/oso-casemgmt-django | 2a5d455015394f95716ba6c62daf330fbdb6fd6a | [
"MIT"
] | 3 | 2020-12-18T13:52:16.000Z | 2021-02-17T17:05:28.000Z | casemgmt/models.py | devmonkey22/oso-casemgmt-django | 2a5d455015394f95716ba6c62daf330fbdb6fd6a | [
"MIT"
] | 1 | 2021-04-13T18:58:17.000Z | 2021-04-13T18:58:17.000Z | casemgmt/models.py | devmonkey22/oso-casemgmt-django | 2a5d455015394f95716ba6c62daf330fbdb6fd6a | [
"MIT"
] | 2 | 2020-12-21T15:10:29.000Z | 2021-02-17T19:22:05.000Z | from django.contrib.auth.models import AbstractUser, Group, Permission, GroupManager
from django.db import models
from django_oso.models import AuthorizedModel
## MODELS ##
class User(AbstractUser):
"""
System users as Case Workers, Supervisors, Auditors, etc.
"""
# basic info
email = models.Char... | 32.758974 | 129 | 0.705855 | from django.contrib.auth.models import AbstractUser, Group, Permission, GroupManager
from django.db import models
from django_oso.models import AuthorizedModel
bstractUser):
email = models.CharField(max_length=256)
class Role(models.Model):
name = models.CharField(max_length=150, unique=True)
permi... | true | true |
1c4aef25deb00cfd4a6a12c8bfa8ad3d271e90a6 | 7,367 | py | Python | onmt/train_single.py | iacercalixto/WALS | 7f4b5042591d536f6b371d5fb252616d2da7abaf | [
"MIT"
] | 1 | 2019-12-19T09:47:35.000Z | 2019-12-19T09:47:35.000Z | onmt/train_single.py | iacercalixto/WALS | 7f4b5042591d536f6b371d5fb252616d2da7abaf | [
"MIT"
] | null | null | null | onmt/train_single.py | iacercalixto/WALS | 7f4b5042591d536f6b371d5fb252616d2da7abaf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Training on a single process
"""
from __future__ import division
import argparse
import os
import random
import torch
import onmt.opts as opts
from onmt.inputters.inputter import build_dataset_iter, lazily_load_dataset, \
_load_fields, _collect_report_features
from onmt.model_builde... | 33.334842 | 181 | 0.681146 |
from __future__ import division
import argparse
import os
import random
import torch
import onmt.opts as opts
from onmt.inputters.inputter import build_dataset_iter, lazily_load_dataset, \
_load_fields, _collect_report_features
from onmt.model_builder import build_model
from onmt.utils.optimizers import build_o... | true | true |
1c4aef758d67003c0f78c72def5acfed40ba9f4c | 271 | py | Python | upol_search_engine/upol_crawler/tools/blacklist.py | UPOLSearch/UPOL-Search-Engine | 791f0a4a01b4d034637ee6dba4cfd254ae8f3f50 | [
"MIT"
] | 1 | 2022-02-02T17:49:23.000Z | 2022-02-02T17:49:23.000Z | upol_search_engine/upol_crawler/tools/blacklist.py | UPOLSearch/UPOL-Search-Engine | 791f0a4a01b4d034637ee6dba4cfd254ae8f3f50 | [
"MIT"
] | 5 | 2017-10-09T09:23:32.000Z | 2017-11-13T08:17:08.000Z | upol_search_engine/upol_crawler/tools/blacklist.py | UPOLSearch/UPOL-Search-Engine | 791f0a4a01b4d034637ee6dba4cfd254ae8f3f50 | [
"MIT"
] | null | null | null | from upol_search_engine.utils import urls
def generate_blacklist(text):
return urls.load_urls_from_text(text)
def is_url_blocked(url, blacklist):
"""Check if url domain is blocked"""
if urls.domain(url) in blacklist:
return True
return False
| 19.357143 | 41 | 0.723247 | from upol_search_engine.utils import urls
def generate_blacklist(text):
return urls.load_urls_from_text(text)
def is_url_blocked(url, blacklist):
if urls.domain(url) in blacklist:
return True
return False
| true | true |
1c4af083e638bd57ce552a8c2584676de6b169bc | 2,063 | py | Python | longclaw/orders/tests.py | MstatiliS/longclaw | 874e35ece3710d1c30ebdadfec9708caa9b6553f | [
"MIT"
] | null | null | null | longclaw/orders/tests.py | MstatiliS/longclaw | 874e35ece3710d1c30ebdadfec9708caa9b6553f | [
"MIT"
] | null | null | null | longclaw/orders/tests.py | MstatiliS/longclaw | 874e35ece3710d1c30ebdadfec9708caa9b6553f | [
"MIT"
] | null | null | null | import mock
from django.test import TestCase
from django.contrib.auth.models import User
from django.urls import reverse_lazy
from django.contrib.auth.models import User
from wagtail.tests.utils import WagtailTestUtils
from longclaw.tests.utils import LongclawTestCase, OrderFactory
from longclaw.orders.wagtail_hooks im... | 34.966102 | 88 | 0.709646 | import mock
from django.test import TestCase
from django.contrib.auth.models import User
from django.urls import reverse_lazy
from django.contrib.auth.models import User
from wagtail.tests.utils import WagtailTestUtils
from longclaw.tests.utils import LongclawTestCase, OrderFactory
from longclaw.orders.wagtail_hooks im... | true | true |
1c4af096765c70ceabadb35d49d28ebfd65052eb | 3,510 | py | Python | test/functional/mempool_compatibility.py | Darrenshome40/shitecoin | a2535c8fc5a43ee21ec818d5367439f6302cd084 | [
"MIT"
] | null | null | null | test/functional/mempool_compatibility.py | Darrenshome40/shitecoin | a2535c8fc5a43ee21ec818d5367439f6302cd084 | [
"MIT"
] | null | null | null | test/functional/mempool_compatibility.py | Darrenshome40/shitecoin | a2535c8fc5a43ee21ec818d5367439f6302cd084 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The shitecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that mempool.dat is both backward and forward compatible between versions
NOTE: The test is des... | 41.294118 | 114 | 0.71567 |
import os
from test_framework.test_framework import shitecoinTestFramework
from test_framework.wallet import MiniWallet
class MempoolCompatibilityTest(shitecoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.wallet_names = [None]
def skip_test_if_missing_module(self):... | true | true |
1c4af0f60e6d67d8d5a2ad58f0c9b68d92d1c96e | 3,583 | py | Python | tensorflow_toolkit/image_retrieval/image_retrieval/common.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 256 | 2020-09-09T03:27:57.000Z | 2022-03-30T10:06:06.000Z | tensorflow_toolkit/image_retrieval/image_retrieval/common.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 604 | 2020-09-08T12:29:49.000Z | 2022-03-31T21:51:08.000Z | tensorflow_toolkit/image_retrieval/image_retrieval/common.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 160 | 2020-09-09T14:06:07.000Z | 2022-03-30T14:50:48.000Z | """
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | 28.895161 | 100 | 0.642757 |
import os
import numpy as np
import cv2
def max_central_square_crop(image):
height, width = image.shape[:2]
if width > height:
image = image[:, (width - height) // 2:(width - height) // 2 + height]
else:
image = image[(height - width) // 2:(height - width) // 2 + width, :]
return ... | true | true |
1c4af275adaa05ba77c5b648c0a78fd0044d8040 | 9,891 | py | Python | src/webapp/azext_webapp/custom.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | src/webapp/azext_webapp/custom.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | src/webapp/azext_webapp/custom.py | mayank88mahajan/azure-cli-extensions | 8bd389a1877bffd14052bec5519ce75dc6fc34cf | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.2125 | 108 | 0.663937 |
from __future__ import print_function
import json
from knack.log import get_logger
from azure.mgmt.web.models import (AppServicePlan, SkuDescription)
from azure.cli.command_modules.appservice.custom import (
enable_zip_deploy,
create_webapp,
update_app_settings,
_get_site_credential,
_get_scm_u... | true | true |
1c4af3134b3e34c42733d1345933b4cd1aa8b0eb | 342 | py | Python | pylib/os_path_test.py | bvberkum/oil | 8b93aeda9e8da8af790d747fcb11d00a673eb58c | [
"Apache-2.0"
] | null | null | null | pylib/os_path_test.py | bvberkum/oil | 8b93aeda9e8da8af790d747fcb11d00a673eb58c | [
"Apache-2.0"
] | null | null | null | pylib/os_path_test.py | bvberkum/oil | 8b93aeda9e8da8af790d747fcb11d00a673eb58c | [
"Apache-2.0"
] | 1 | 2021-03-06T22:08:23.000Z | 2021-03-06T22:08:23.000Z | #!/usr/bin/env python2
"""
os_path_test.py: Tests for os_path.py
"""
from __future__ import print_function
import unittest
from pylib import os_path # module under test
class OsPathTest(unittest.TestCase):
def testBasename(self):
self.assertEqual('bar', os_path.basename('foo/bar'))
if __name__ == '__main_... | 17.1 | 56 | 0.733918 |
from __future__ import print_function
import unittest
from pylib import os_path
class OsPathTest(unittest.TestCase):
def testBasename(self):
self.assertEqual('bar', os_path.basename('foo/bar'))
if __name__ == '__main__':
unittest.main()
| true | true |
1c4af34de1b3fe4ed1ff6c877d7aaa3d3b36f519 | 295 | py | Python | llvm_headers/conanfile.py | Manu343726/clang-conan-packages | 4739985e95d4b0cc3f682ad0c7f5229697584136 | [
"MIT"
] | 5 | 2020-01-16T09:42:22.000Z | 2021-06-24T03:33:29.000Z | recipes/llvm_headers/conanfile.py | bincrafters/conan-llvm | caa0f2da0086978b88631df6a545a13819588407 | [
"MIT"
] | 3 | 2020-01-16T00:04:32.000Z | 2020-01-16T01:38:59.000Z | llvm_headers/conanfile.py | Manu343726/clang-conan-packages | 4739985e95d4b0cc3f682ad0c7f5229697584136 | [
"MIT"
] | 2 | 2020-04-06T23:08:59.000Z | 2020-05-28T06:25:33.000Z | from conans import python_requires
common = python_requires('llvm-common/0.0.0@Manu343726/testing')
class LLVMHeaders(common.LLVMModulePackage):
version = common.LLVMModulePackage.version
name = 'llvm_headers'
llvm_component = 'llvm'
header_only = True
include_dirs = ['']
| 26.818182 | 64 | 0.742373 | from conans import python_requires
common = python_requires('llvm-common/0.0.0@Manu343726/testing')
class LLVMHeaders(common.LLVMModulePackage):
version = common.LLVMModulePackage.version
name = 'llvm_headers'
llvm_component = 'llvm'
header_only = True
include_dirs = ['']
| true | true |
1c4af46bbed39d9dc35000b7d9f4aea79877771f | 4,760 | py | Python | logger.py | HaoranZ99/RL-2 | 253c2fd8c705f88d9cc79abd9f331dc99b5895eb | [
"MIT"
] | null | null | null | logger.py | HaoranZ99/RL-2 | 253c2fd8c705f88d9cc79abd9f331dc99b5895eb | [
"MIT"
] | null | null | null | logger.py | HaoranZ99/RL-2 | 253c2fd8c705f88d9cc79abd9f331dc99b5895eb | [
"MIT"
] | null | null | null | import numpy as np
import time, datetime
import matplotlib.pyplot as plt
class Logger():
def __init__(self, save_dir):
self.save_log = save_dir / "log"
with open(self.save_log, "w") as f:
f.write(
f"{'Episode':>8}{'Step':>8}{'Epsilon':>10}{'MeanReward':>15}"
... | 37.480315 | 101 | 0.576471 | import numpy as np
import time, datetime
import matplotlib.pyplot as plt
class Logger():
def __init__(self, save_dir):
self.save_log = save_dir / "log"
with open(self.save_log, "w") as f:
f.write(
f"{'Episode':>8}{'Step':>8}{'Epsilon':>10}{'MeanReward':>15}"
... | true | true |
1c4af486fea5fc7d523969abc73ef3add41db54f | 7,727 | py | Python | src/aks-preview/azext_aks_preview/commands.py | xiazhan/azure-cli-extensions | fa33dba098c1c4aa7624a9d8393722a9dabd050a | [
"MIT"
] | null | null | null | src/aks-preview/azext_aks_preview/commands.py | xiazhan/azure-cli-extensions | fa33dba098c1c4aa7624a9d8393722a9dabd050a | [
"MIT"
] | 1 | 2021-07-12T22:10:21.000Z | 2021-07-12T22:10:21.000Z | src/aks-preview/azext_aks_preview/commands.py | xiazhan/azure-cli-extensions | fa33dba098c1c4aa7624a9d8393722a9dabd050a | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 56.40146 | 142 | 0.711143 |
from azure.cli.core.commands import CliCommandType
from ._client_factory import cf_managed_clusters
from ._client_factory import cf_maintenance_configurations
from ._client_factory import cf_container_services
from ._client_factory import cf_agent_pools
from ._format import aks_show_table_format
from ._format imp... | true | true |
1c4af53588d57359ae6d05b519a1dc4f2f7ca79b | 1,981 | py | Python | ampel/mongo/query/general.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | ampel/mongo/query/general.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | ampel/mongo/query/general.py | mafn/Ampel-core | 744acbf36f0a2ceae7230ceab1350236c1501b57 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: Ampel-core/ampel/mongo/query/general.py
# License: BSD-3-Clause
# Author: valery brinnel <firstname.lastname@gmail.com>
# Date: 11.12.2019
# Last Modified Date: 17.02.2021
# Last Modified By: valery brinnel ... | 36.018182 | 112 | 0.710752 |
from bson.int64 import Int64
from typing import Any, Literal
from ampel.types import Tag, ChannelId, StockId, StrictIterable
from ampel.model.operator.AnyOf import AnyOf
from ampel.model.operator.AllOf import AllOf
from ampel.model.operator.OneOf import OneOf
from ampel.mongo.utils import maybe_match_array
fro... | true | true |
1c4af5509e74f37a845df6918bcfcc8286f347c3 | 307 | py | Python | PycharmProjects/PythonExercicios/ex030.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | PycharmProjects/PythonExercicios/ex030.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | PycharmProjects/PythonExercicios/ex030.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | #Crie um programa que leia um número inteiro e mostre na tela se ele é PAR ou ÍMPAR
num = input('Digite um número inteiro, e eu vou lhe dizer se ele é par ou impar: ').strip()
num = int(num)
if num % 2 == 0:
print(f'O número {num} é um número par.')
else:
print(f'O número {num} é um número impar.') | 43.857143 | 91 | 0.674267 |
num = input('Digite um número inteiro, e eu vou lhe dizer se ele é par ou impar: ').strip()
num = int(num)
if num % 2 == 0:
print(f'O número {num} é um número par.')
else:
print(f'O número {num} é um número impar.') | true | true |
1c4af5a3dd37ea59624418f4740c2e857872d948 | 9,018 | py | Python | backend/cookie/cookie/config/settings/production.py | NehemiasEC/BS | 7ce92a4efd7522f2ee7b35cce7620c3d125510ca | [
"MIT"
] | 1 | 2020-05-27T03:56:02.000Z | 2020-05-27T03:56:02.000Z | backend/cookie/cookie/config/settings/production.py | NehemiasEC/BS | 7ce92a4efd7522f2ee7b35cce7620c3d125510ca | [
"MIT"
] | 21 | 2020-05-28T06:23:37.000Z | 2022-03-12T00:51:49.000Z | backend/cookie/cookie/config/settings/production.py | NehemiasEC/BS | 7ce92a4efd7522f2ee7b35cce7620c3d125510ca | [
"MIT"
] | null | null | null | import logging
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.celery import CeleryIntegration
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------... | 41.944186 | 100 | 0.634952 | import logging
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.celery import CeleryIntegration
from .base import *
from .base import env
= env("DJANGO_SECRET_KEY")
= env.list("DJANGO_ALLO... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.