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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f75a916fa6675d1c53b90c3a1541b665839bf78f | 5,965 | py | Python | tests/sshelve_test.py | aragagnin/sqlite3db-py3 | 4a1cf9992d1e636db6c1405a6a0e65ca1f91f422 | [
"Apache-2.0"
] | null | null | null | tests/sshelve_test.py | aragagnin/sqlite3db-py3 | 4a1cf9992d1e636db6c1405a6a0e65ca1f91f422 | [
"Apache-2.0"
] | 1 | 2017-10-27T13:48:21.000Z | 2017-10-27T13:48:21.000Z | tests/sshelve_test.py | YelpArchive/sqlite3dbm | 35db0b9029e98ae80fe84880ca8ce71d4b2d43bd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2011 Yelp
#
# 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 ... | 29.974874 | 78 | 0.584744 |
import os
import shutil
import tempfile
import time
import testify
import sqlite3dbm
class TestSqliteShelf(testify.TestCase):
@testify.setup
def create_shelf(self):
self.tmpdir = tempfile.mkdtemp()
self.path = os.path.join(self.tmpdir, 'sqlite_map_test_db.sqlite')
self.smap = sqlite... | true | true |
f75a91fdec3fe24c412f2e5f9c8dd9c44576d9f2 | 10,399 | py | Python | install/app_store/tk-multi-shotgunpanel/v1.4.8/python/app/model_task_listing.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | null | null | null | install/app_store/tk-multi-shotgunpanel/v1.4.8/python/app/model_task_listing.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | null | null | null | install/app_store/tk-multi-shotgunpanel/v1.4.8/python/app/model_task_listing.py | JoanAzpeitia/lp_sg | e0ee79555e419dd2ae3a5f31e5515b3f40b22a62 | [
"MIT"
] | 1 | 2020-02-15T10:42:56.000Z | 2020-02-15T10:42:56.000Z | # Copyright (c) 2015 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... | 44.823276 | 96 | 0.660352 |
from sgtk.platform.qt import QtCore, QtGui
import sgtk
from . import utils
from .model_entity_listing import SgEntityListingModel
shotgun_model = sgtk.platform.import_framework("tk-framework-shotgunutils", "shotgun_model")
ShotgunModel = shotgun_model.ShotgunModel
class SgTaskListingModel(SgEntityListingModel):
... | true | true |
f75a930717dcef4285f21394c3db04ae28752304 | 19,049 | py | Python | SLKlib/arn_build_new.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | SLKlib/arn_build_new.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | SLKlib/arn_build_new.py | korcsmarosgroup/ARN2DataBase | 8931cec0387e5c8b599df40d652ac5fdb5c49a8f | [
"MIT"
] | null | null | null | """
This script builds the multi-structured database. Each node is present in every layer.
The higher layer has the edges from the previous layer and their first neighbours.
"""
import sqlite3
from collections import OrderedDict as od
# Building mock data set
DB = od([('signor', 'SLK_Core'),
('PSP', ... | 42.615213 | 251 | 0.560922 |
import sqlite3
from collections import OrderedDict as od
DB = od([('signor', 'SLK_Core'),
('PSP', 'layer1'),
('PhosphoSite', 'PTM'),
('OmniPath', 'ATG_Reg'),
('miRDeathDB', 'miRNA'),
('starbase', 'lncRNA')])
def get_mockdata():
with open('mockdata.tsv', 'w') as mockf... | true | true |
f75a954ca86aec4c0fafd368f18e8c5bd95f8994 | 1,522 | py | Python | molssi_devops_uf/molssi_math.py | zdong1995/molssi_devops_uf | dc2d948bc4359d23e123a4124fdbd194218a3d37 | [
"BSD-3-Clause"
] | null | null | null | molssi_devops_uf/molssi_math.py | zdong1995/molssi_devops_uf | dc2d948bc4359d23e123a4124fdbd194218a3d37 | [
"BSD-3-Clause"
] | null | null | null | molssi_devops_uf/molssi_math.py | zdong1995/molssi_devops_uf | dc2d948bc4359d23e123a4124fdbd194218a3d37 | [
"BSD-3-Clause"
] | 1 | 2020-06-18T22:15:44.000Z | 2020-06-18T22:15:44.000Z | """
molssi_devops_uf.py
Workshop
Handles the primary functions
"""
def mean(num_list):
"""
Calculate the mean/average of a list of numbers
Parameters
------------
num_list : list
THe list to take the average of
Returns
------------
mean_list : float
The mean of the ... | 23.415385 | 92 | 0.63272 |
def mean(num_list):
if not isinstance(num_list, list):
raise TypeError('Invalid input %s - Input must be type list' %(num_list))
if num_list == []:
raise ValueError('Cannot apply mean function to empty list')
try:
mean_list = sum(num_list) / len(num_list)
except T... | true | true |
f75a96a83c8499d82e34a4aa5363eb2d1e1f8407 | 3,100 | py | Python | runway/templates/k8s-cfn-repo/k8s-master.cfn/k8s_hooks/bootstrap.py | paul-duffy/runway | a0c22eb7ca7b55df5317bdda92c08c4bb39569d2 | [
"Apache-2.0"
] | 1 | 2020-02-25T21:08:00.000Z | 2020-02-25T21:08:00.000Z | runway/templates/k8s-cfn-repo/k8s-master.cfn/k8s_hooks/bootstrap.py | paul-duffy/runway | a0c22eb7ca7b55df5317bdda92c08c4bb39569d2 | [
"Apache-2.0"
] | 2 | 2020-01-07T15:00:55.000Z | 2020-01-07T15:03:25.000Z | runway/templates/k8s-cfn-repo/k8s-master.cfn/k8s_hooks/bootstrap.py | voodooGQ/runway | 8a744f33b39f1342022f1b57db996bb843e4556c | [
"Apache-2.0"
] | null | null | null | """Execute the AWS CLI update-kubeconfig command."""
from __future__ import print_function
import os
import logging
import shutil
import six
import yaml
LOGGER = logging.getLogger(__name__)
def copy_template_to_env(path, env, region):
"""Copy k8s module template into new environment directory."""
overlays_d... | 39.74359 | 100 | 0.595484 | from __future__ import print_function
import os
import logging
import shutil
import six
import yaml
LOGGER = logging.getLogger(__name__)
def copy_template_to_env(path, env, region):
overlays_dir = os.path.join(path, 'overlays')
template_dir = os.path.join(overlays_dir, 'template')
env_dir = os.path.join... | true | true |
f75a976fb57ce31f300c0e129159e34b4a1658f5 | 12,102 | py | Python | src/m7_more_mutation.py | callahrs/SequencesAndMutation | 88bbb3fc44984f5a029f75f4d7080fd274662200 | [
"MIT"
] | null | null | null | src/m7_more_mutation.py | callahrs/SequencesAndMutation | 88bbb3fc44984f5a029f75f4d7080fd274662200 | [
"MIT"
] | null | null | null | src/m7_more_mutation.py | callahrs/SequencesAndMutation | 88bbb3fc44984f5a029f75f4d7080fd274662200 | [
"MIT"
] | null | null | null | """
This module lets you practice MUTATION of objects
by changing the values of instance variables.
Authors: David Mutchler, Amanda Stouder, Chandan Rupakheti, Katie Dion,
Claude Anderson, Delvin Defoe, Curt Clifton, their colleagues,
and PUT_YOUR_NAME_HERE.
""" # Done: 1. PUT YOUR NAME IN THE A... | 37.583851 | 77 | 0.618741 |
import rosegraphics as rg
def main():
run_test_RETURN_circle()
run_test_MUTATE_circle()
def run_test_RETURN_circle():
print()
print('-----------------------------------------')
print('Testing RETURN_circle:')
print('-----------------------------------------')
print()
print('See the... | true | true |
f75a97f807b6d1ddb0aadb6d2f76ab8d943ab5e9 | 61 | py | Python | funcs/other/__init__.py | ridhwan-aziz/zipra_bot | de328e518aa6876fa91e96e007c198aae8ff2fd4 | [
"MIT"
] | 4 | 2021-11-11T03:44:21.000Z | 2022-03-26T14:32:20.000Z | funcs/other/__init__.py | ridhwan-aziz/zipra_bot | de328e518aa6876fa91e96e007c198aae8ff2fd4 | [
"MIT"
] | 2 | 2021-11-23T07:02:35.000Z | 2022-02-11T13:49:07.000Z | funcs/other/__init__.py | ridhwan-aziz/zipra_bot | de328e518aa6876fa91e96e007c198aae8ff2fd4 | [
"MIT"
] | 1 | 2021-11-25T13:30:24.000Z | 2021-11-25T13:30:24.000Z | from funcs.other import scope, debugmode, report_bug, my_eval | 61 | 61 | 0.836066 | from funcs.other import scope, debugmode, report_bug, my_eval | true | true |
f75a9950374c83f09ad4cb9a51c1e608ea44ddca | 1,372 | py | Python | ruddock/modules/birthdays/routes.py | calebsander/RuddockWebsite | e6497bfdecffdfb712c36085fa1df93d08380dd2 | [
"MIT"
] | 7 | 2015-01-31T20:07:23.000Z | 2020-04-11T16:36:08.000Z | ruddock/modules/birthdays/routes.py | calebsander/RuddockWebsite | e6497bfdecffdfb712c36085fa1df93d08380dd2 | [
"MIT"
] | 103 | 2015-01-01T08:31:41.000Z | 2022-02-14T06:17:58.000Z | ruddock/modules/birthdays/routes.py | mply/RuddockWebsite | 63f1f25da5bef842b5b2337592186f8e23c1803b | [
"MIT"
] | 8 | 2017-10-01T07:27:34.000Z | 2020-05-04T01:49:30.000Z | import json
import flask
import datetime
from ruddock.resources import Permissions
from ruddock.decorators import login_required
from ruddock.modules.birthdays import blueprint, helpers
@blueprint.route('/')
@login_required(Permissions.BIRTHDAYS)
def show_bdays():
"""Displays a list of birthdays for current studen... | 26.901961 | 72 | 0.687318 | import json
import flask
import datetime
from ruddock.resources import Permissions
from ruddock.decorators import login_required
from ruddock.modules.birthdays import blueprint, helpers
@blueprint.route('/')
@login_required(Permissions.BIRTHDAYS)
def show_bdays():
today = datetime.date.today()
ref_date = toda... | true | true |
f75a9a4c9f13d2400d56d6c2ffa978a09467ee8c | 325 | py | Python | dags/emr/core/queries/tc/practitioner_schedule_query.py | superoutput/airflow-data-analytics | dcd2280cc6e1448226540bfad3f11614353ea052 | [
"Apache-2.0"
] | null | null | null | dags/emr/core/queries/tc/practitioner_schedule_query.py | superoutput/airflow-data-analytics | dcd2280cc6e1448226540bfad3f11614353ea052 | [
"Apache-2.0"
] | null | null | null | dags/emr/core/queries/tc/practitioner_schedule_query.py | superoutput/airflow-data-analytics | dcd2280cc6e1448226540bfad3f11614353ea052 | [
"Apache-2.0"
] | null | null | null | from hms_workflow_platform.core.queries.base.base_query import *
class PractitionerScheduleQuery(BaseQuery):
def __init__(self, site):
super().__init__()
self.adapter = self.get_adapter(site)
self.query = self.adapter.query
def practitioner_schedule_create(self, date):
return ... | 27.083333 | 64 | 0.710769 | from hms_workflow_platform.core.queries.base.base_query import *
class PractitionerScheduleQuery(BaseQuery):
def __init__(self, site):
super().__init__()
self.adapter = self.get_adapter(site)
self.query = self.adapter.query
def practitioner_schedule_create(self, date):
return ... | true | true |
f75a9a637f66f9b04704984727aaad50133cae71 | 480 | py | Python | app/users/migrations/0005_auto_20201024_1416.py | Valaraucoo/raven | 0157e193baf569be9479a78838dc26d77a11a99d | [
"BSD-3-Clause"
] | 3 | 2020-12-27T21:52:52.000Z | 2021-08-23T10:26:10.000Z | app/users/migrations/0005_auto_20201024_1416.py | Valaraucoo/raven | 0157e193baf569be9479a78838dc26d77a11a99d | [
"BSD-3-Clause"
] | 12 | 2020-12-22T22:36:28.000Z | 2021-01-18T13:39:34.000Z | app/users/migrations/0005_auto_20201024_1416.py | Valaraucoo/raven | 0157e193baf569be9479a78838dc26d77a11a99d | [
"BSD-3-Clause"
] | 2 | 2020-12-27T21:52:39.000Z | 2021-11-18T08:08:25.000Z | # Generated by Django 3.0.7 on 2020-10-24 14:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20201017_1631'),
]
operations = [
migrations.AlterField(
model_name='user',
name='date_birth',
... | 25.263158 | 144 | 0.620833 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20201017_1631'),
]
operations = [
migrations.AlterField(
model_name='user',
name='date_birth',
field=models.DateField(blank=True, hel... | true | true |
f75a9aac237d976310b0ac4bb543502d9042bb35 | 3,175 | py | Python | tests/integration/test_storage_mongodb/test.py | lizhichao/ClickHouse | 3f5dc37095ccca18de490fab162d6e3cb99756aa | [
"Apache-2.0"
] | 18 | 2021-05-29T01:12:33.000Z | 2021-11-18T12:34:48.000Z | tests/integration/test_storage_mongodb/test.py | lizhichao/ClickHouse | 3f5dc37095ccca18de490fab162d6e3cb99756aa | [
"Apache-2.0"
] | 13 | 2019-06-06T09:45:53.000Z | 2020-05-15T12:03:45.000Z | tests/integration/test_storage_mongodb/test.py | lizhichao/ClickHouse | 3f5dc37095ccca18de490fab162d6e3cb99756aa | [
"Apache-2.0"
] | 22 | 2019-06-14T10:31:51.000Z | 2020-10-12T14:57:44.000Z | import pymongo
import pytest
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', with_mongo=True)
@pytest.fixture(scope="module")
def started_cluster():
try:
cluster.start()
yie... | 35.277778 | 162 | 0.687559 | import pymongo
import pytest
from helpers.client import QueryRuntimeException
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', with_mongo=True)
@pytest.fixture(scope="module")
def started_cluster():
try:
cluster.start()
yie... | true | true |
f75a9bd13c096ed52860d2dacd482fc09ed8506f | 1,854 | py | Python | civic_jabber_ingest/cli.py | civic-jabber/data-ingest | bf44c6041ad947547ceede535124c5db004d2f43 | [
"MIT"
] | null | null | null | civic_jabber_ingest/cli.py | civic-jabber/data-ingest | bf44c6041ad947547ceede535124c5db004d2f43 | [
"MIT"
] | 26 | 2020-10-03T21:08:11.000Z | 2020-12-22T22:39:35.000Z | civic_jabber_ingest/cli.py | civic-jabber/data-ingest | bf44c6041ad947547ceede535124c5db004d2f43 | [
"MIT"
] | null | null | null | import click
import pandas as pd
from civic_jabber_ingest.external_services.newspaper import load_news
from civic_jabber_ingest.external_services.open_states import get_all_people
from civic_jabber_ingest.regs.va import load_va_regulations
from civic_jabber_ingest.utils.config import read_config
@click.group()
def ... | 25.75 | 86 | 0.678533 | import click
import pandas as pd
from civic_jabber_ingest.external_services.newspaper import load_news
from civic_jabber_ingest.external_services.open_states import get_all_people
from civic_jabber_ingest.regs.va import load_va_regulations
from civic_jabber_ingest.utils.config import read_config
@click.group()
def ... | true | true |
f75a9be523d7fa268e2b8e6d95794d3934ea03c1 | 3,599 | py | Python | virtool/jobs/db.py | ColeVoelpel/virtool | 859c8d2516f07343bde47f3bae0247dedd76e6c4 | [
"MIT"
] | 1 | 2019-08-23T00:19:00.000Z | 2019-08-23T00:19:00.000Z | virtool/jobs/db.py | ColeVoelpel/virtool | 859c8d2516f07343bde47f3bae0247dedd76e6c4 | [
"MIT"
] | null | null | null | virtool/jobs/db.py | ColeVoelpel/virtool | 859c8d2516f07343bde47f3bae0247dedd76e6c4 | [
"MIT"
] | null | null | null | """
Globals and utility functions for interacting with the jobs collection in the application database.
"""
import virtool.jobs.manager
import virtool.utils
OR_COMPLETE = [
{"status.state": "complete"}
]
OR_FAILED = [
{"status.state": "error"},
{"status.state": "cancelled"}
]
#: The default MongoDB proj... | 22.778481 | 115 | 0.529036 | import virtool.jobs.manager
import virtool.utils
OR_COMPLETE = [
{"status.state": "complete"}
]
OR_FAILED = [
{"status.state": "error"},
{"status.state": "cancelled"}
]
PROJECTION = [
"_id",
"task",
"status",
"proc",
"mem",
"user"
]
async def cancel(db, job_id):
document = a... | true | true |
f75a9c0f44ef9093baae6b95929e027603685d20 | 23,274 | py | Python | src/sentry/testutils/fixtures.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | null | null | null | src/sentry/testutils/fixtures.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | null | null | null | src/sentry/testutils/fixtures.py | sigismund/sentry | 421a512cd3b4a4c9ed660af536dc5bc4c12a287c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
sentry.testutils.fixtures
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function, unicode_literals
import copy
import json
import os
import... | 36.59434 | 324 | 0.496735 | from __future__ import absolute_import, print_function, unicode_literals
import copy
import json
import os
import petname
import random
import six
import warnings
from django.db import IntegrityError, transaction
from django.utils import timezone
from django.utils.text import slugify
from exam import fixture
from has... | true | true |
f75a9cf1e9532132c9f51a9187628d66fc88011c | 734 | py | Python | djangobench/benchmarks/query_delete_related/benchmark.py | smithdc1/djangobench | 912dc536db706fb73d24a53d10d1739a0824d2c1 | [
"BSD-3-Clause"
] | 92 | 2015-02-07T11:03:45.000Z | 2022-03-23T10:51:06.000Z | djangobench/benchmarks/query_delete_related/benchmark.py | smithdc1/djangobench | 912dc536db706fb73d24a53d10d1739a0824d2c1 | [
"BSD-3-Clause"
] | 19 | 2015-03-22T14:30:03.000Z | 2022-03-24T22:43:24.000Z | djangobench/benchmarks/query_delete_related/benchmark.py | smithdc1/djangobench | 912dc536db706fb73d24a53d10d1739a0824d2c1 | [
"BSD-3-Clause"
] | 25 | 2015-01-22T19:53:25.000Z | 2022-03-20T11:15:54.000Z | from djangobench.utils import run_benchmark
def benchmark():
global Book
Book.objects.all().delete()
def setup():
global Book
from query_delete_related.models import Book, Chapter
b1 = Book.objects.create(title='hi')
b2 = Book.objects.create(title='hi')
b3 = Book.objects.create(title='hi'... | 27.185185 | 65 | 0.63624 | from djangobench.utils import run_benchmark
def benchmark():
global Book
Book.objects.all().delete()
def setup():
global Book
from query_delete_related.models import Book, Chapter
b1 = Book.objects.create(title='hi')
b2 = Book.objects.create(title='hi')
b3 = Book.objects.create(title='hi'... | true | true |
f75a9d90caedd92cce1a77eeaf47dc883361d99a | 14,814 | py | Python | lib/datasets/pascal_voc.py | beaulian/fpn.pytorch | 49fe36711cff71e26d9bef838613577dabd02336 | [
"MIT"
] | null | null | null | lib/datasets/pascal_voc.py | beaulian/fpn.pytorch | 49fe36711cff71e26d9bef838613577dabd02336 | [
"MIT"
] | null | null | null | lib/datasets/pascal_voc.py | beaulian/fpn.pytorch | 49fe36711cff71e26d9bef838613577dabd02336 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import xml.dom.minidom as minidom
import os
# import PIL
import numpy ... | 39.822581 | 88 | 0.547455 |
import xml.dom.minidom as minidom
import os
import numpy as np
import scipy.sparse
import subprocess
import six.moves.cPickle as cPickle
import math
import glob
import uuid
import scipy.io as sio
import xml.etree.ElementTree as ET
from .imdb import imdb
from .imdb import ROOT_DIR
from datasets import ds_utils
from .... | true | true |
f75a9e2875e59ab9995cb3107010b55dec59af0b | 10,991 | py | Python | cvss.py | binexisHATT/CVSS-Analyzer | 52824b1a19284f2a6afbfd800a465719758a0ff9 | [
"MIT"
] | null | null | null | cvss.py | binexisHATT/CVSS-Analyzer | 52824b1a19284f2a6afbfd800a465719758a0ff9 | [
"MIT"
] | null | null | null | cvss.py | binexisHATT/CVSS-Analyzer | 52824b1a19284f2a6afbfd800a465719758a0ff9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
__author__ = 'Alexis Rodriguez'
__version__ = '1.0'
__email__ = 'rodriguez10011999@gmail.com'
"""
Sources used for scoring descriptions:
- CompTIA CySa+ Study Guide by Mike Chapple and David Seidl
- https://www.first.org/cvss/v3.0/specification-document
Example CVSS v2 : CVSS2#AV:N/AC:L/... | 43.615079 | 331 | 0.68729 |
__author__ = 'Alexis Rodriguez'
__version__ = '1.0'
__email__ = 'rodriguez10011999@gmail.com'
try:
from sys import argv, exit
from os import _exit
except ImportError as err:
print(f"Import Error: {err}")
access_vector = {
'L': 'Local (L): The attacker must have physical or logical access to the affected sys... | true | true |
f75a9ec33c8a1bbc51023be568d3ece3a6398fb4 | 51 | py | Python | Notes/wsgi.py | Mi-As/Lists-RestApi | eea238f9fc5fda4b992f33dd2c7a4725a74849bb | [
"MIT"
] | 1 | 2020-10-31T20:15:21.000Z | 2020-10-31T20:15:21.000Z | Notes/wsgi.py | Mi-As/Note-RestApi | eea238f9fc5fda4b992f33dd2c7a4725a74849bb | [
"MIT"
] | null | null | null | Notes/wsgi.py | Mi-As/Note-RestApi | eea238f9fc5fda4b992f33dd2c7a4725a74849bb | [
"MIT"
] | null | null | null | #!/usr/bin/python
from . import app as application | 17 | 32 | 0.745098 |
from . import app as application | true | true |
f75a9f11ae774c760ea646a7e2aa9a5ba17792ef | 3,428 | py | Python | src/out/NIPS18evaluation/evaluationRNN/min-char-rnn-pytorch.py | supunab/Lantern | 932a031816617d71c46653f3b2245129a6a8a7c8 | [
"BSD-3-Clause"
] | 158 | 2018-03-28T21:58:07.000Z | 2022-02-22T00:49:46.000Z | src/out/NIPS18evaluation/evaluationRNN/min-char-rnn-pytorch.py | douxiansheng/Lantern | f453de532da638c1f467953b32bbe49a3dedfa45 | [
"BSD-3-Clause"
] | 35 | 2018-09-03T21:27:15.000Z | 2019-05-11T02:17:49.000Z | src/out/NIPS18evaluation/evaluationRNN/min-char-rnn-pytorch.py | douxiansheng/Lantern | f453de532da638c1f467953b32bbe49a3dedfa45 | [
"BSD-3-Clause"
] | 15 | 2018-03-29T06:29:22.000Z | 2020-05-20T06:56:03.000Z | """
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
def run(write_to):
torch.set_num_threads(1)
start = time.time()
data = open... | 28.566667 | 81 | 0.664819 | import numpy as np
import time
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
def run(write_to):
torch.set_num_threads(1)
start = time.time()
data = open('graham.txt', 'r').read() chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
... | true | true |
f75a9feb978e96bd6831b5e60ba5e245c992c22e | 5,873 | py | Python | terrainbento/derived_models/model_440_basicChSa/model_440_basicChSa.py | mcflugen/terrainbento | 1b756477b8a8ab6a8f1275b1b30ec84855c840ea | [
"MIT"
] | null | null | null | terrainbento/derived_models/model_440_basicChSa/model_440_basicChSa.py | mcflugen/terrainbento | 1b756477b8a8ab6a8f1275b1b30ec84855c840ea | [
"MIT"
] | null | null | null | terrainbento/derived_models/model_440_basicChSa/model_440_basicChSa.py | mcflugen/terrainbento | 1b756477b8a8ab6a8f1275b1b30ec84855c840ea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
model_440_basicChSa.py: erosion model using depth-dependent cubic diffusion
with a soil layer, basic stream power, and discharge proportional to drainage
area.
Model 440 BasicChSa
Landlab components used: FlowRouter, DepressionFinderAndRouter,
FastscapeStreamPower,... | 39.952381 | 135 | 0.606504 |
from terrainbento.base_class import ErosionModel
from landlab.components import (FlowAccumulator, DepressionFinderAndRouter,
FastscapeEroder, DepthDependentTaylorDiffuser,
ExponentialWeatherer)
import numpy as np
class BasicChSa(ErosionModel):
def ... | true | true |
f75aa1c06a350926df8a67bfe406711e9408bd15 | 24,211 | py | Python | UefiBuild/CoreBuild/PlatformBuildWorker.py | StefMa/mu_basecore | 12287e65da8053c8d43d198ad94d0cb2e5a8367d | [
"BSD-2-Clause"
] | null | null | null | UefiBuild/CoreBuild/PlatformBuildWorker.py | StefMa/mu_basecore | 12287e65da8053c8d43d198ad94d0cb2e5a8367d | [
"BSD-2-Clause"
] | null | null | null | UefiBuild/CoreBuild/PlatformBuildWorker.py | StefMa/mu_basecore | 12287e65da8053c8d43d198ad94d0cb2e5a8367d | [
"BSD-2-Clause"
] | null | null | null | ##
## Script to Build CORE UEFI firmware
##
##
## Copyright Microsoft Corporation, 2015
##
IgnoreList = [ "nt32pkg.dsc", #NT32 pkg requires windows headers which are not supplied on build system
"Nt32PkgMsCapsule.dsc", #NT32 capsule pkg requires windows headers which a... | 43.156863 | 264 | 0.575978 |
IgnoreList = [ "nt32pkg.dsc", "Nt32PkgMsCapsule.dsc", "IntelFrameworkModulePkg.dsc", "IntelFrameworkPkg.dsc", "ArmCrashDumpDxe.dsc", "ArmPkg.dsc",
"ArmPlatform... | true | true |
f75aa2c2af6a9931e2a9de90c645b646550b85b0 | 321 | py | Python | src/pypkg_x8uqn/__init__.py | goerz-forks/pypkg_x8uqn | 4408845621959767da562797eb1fa7e06621f353 | [
"BSD-3-Clause"
] | 1 | 2019-12-26T05:18:09.000Z | 2019-12-26T05:18:09.000Z | src/pypkg_x8uqn/__init__.py | goerz-forks/pypkg_x8uqn | 4408845621959767da562797eb1fa7e06621f353 | [
"BSD-3-Clause"
] | 3 | 2019-12-25T23:11:46.000Z | 2019-12-30T15:03:04.000Z | src/pypkg_x8uqn/__init__.py | goerz-forks/pypkg_x8uqn | 4408845621959767da562797eb1fa7e06621f353 | [
"BSD-3-Clause"
] | null | null | null | """Top-level package."""
__version__ = '0.1.3+dev'
__all__ = ['func', 'PROJECT_CONST']
__private__ = []
__known_refs__ = {'PROJECT_CONST': ':obj:`~.subpkg.submod.PROJECT_CONST`'}
from . import mod
from .subpkg.submod import PROJECT_CONST
def func(a):
"""This is a function that just returns `a`."""
return a... | 20.0625 | 74 | 0.672897 |
__version__ = '0.1.3+dev'
__all__ = ['func', 'PROJECT_CONST']
__private__ = []
__known_refs__ = {'PROJECT_CONST': ':obj:`~.subpkg.submod.PROJECT_CONST`'}
from . import mod
from .subpkg.submod import PROJECT_CONST
def func(a):
return a
| true | true |
f75aa383bf7f49607decf952488ad9927d108862 | 1,541 | py | Python | octopus/process/process_queue.py | parker-pu/octopus | 18171127fea7f7337d121b6042e1308e4dff6668 | [
"Apache-2.0"
] | null | null | null | octopus/process/process_queue.py | parker-pu/octopus | 18171127fea7f7337d121b6042e1308e4dff6668 | [
"Apache-2.0"
] | null | null | null | octopus/process/process_queue.py | parker-pu/octopus | 18171127fea7f7337d121b6042e1308e4dff6668 | [
"Apache-2.0"
] | null | null | null | import logging
import multiprocessing
from multiprocessing import Queue
LOG = logging.getLogger('octopus')
class ProcessQueue:
__instance = None
def __new__(cls, *args, **kwargs):
if cls.__instance:
return cls.__instance
else:
obj = super().__new__(cls, *args, **kwarg... | 28.018182 | 75 | 0.56976 | import logging
import multiprocessing
from multiprocessing import Queue
LOG = logging.getLogger('octopus')
class ProcessQueue:
__instance = None
def __new__(cls, *args, **kwargs):
if cls.__instance:
return cls.__instance
else:
obj = super().__new__(cls, *args, **kwarg... | true | true |
f75aa587ac4815b326f65e3e83966a043d72eaa7 | 3,176 | py | Python | src/build/fuchsia/fvdl_target_test.py | klzgrad/naiveproxy | 60a61ea6d52612182cc3d727f873146c4fb5e0f6 | [
"BSD-3-Clause"
] | 2,219 | 2018-03-26T02:57:34.000Z | 2022-03-31T00:27:59.000Z | src/build/fuchsia/fvdl_target_test.py | klzgrad/naiveproxy | 60a61ea6d52612182cc3d727f873146c4fb5e0f6 | [
"BSD-3-Clause"
] | 250 | 2018-02-02T23:16:57.000Z | 2022-03-21T06:09:53.000Z | src/build/fuchsia/fvdl_target_test.py | klzgrad/naiveproxy | 60a61ea6d52612182cc3d727f873146c4fb5e0f6 | [
"BSD-3-Clause"
] | 473 | 2019-03-24T16:34:23.000Z | 2022-03-31T02:01:05.000Z | #!/usr/bin/env python3
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests different flags to see if they are being used correctly"""
import boot_data
import common
import unittest
import unittest.mo... | 41.789474 | 74 | 0.705605 |
import boot_data
import common
import unittest
import unittest.mock as mock
from argparse import Namespace
from fvdl_target import _FVDL_PATH, FvdlTarget, _SSH_KEY_DIR
class TestBuildCommandFvdlTarget(unittest.TestCase):
def setUp(self):
self.args = Namespace(out_dir='outdir',
syste... | true | true |
f75aa694064ede8f40f16986aa2919754c7cf70a | 4,293 | py | Python | tb/test_arbiter.py | wufubao/verilog-axis | 7c6da337b05e5eea675159798aa979f459d89095 | [
"MIT"
] | 2 | 2018-08-25T03:10:41.000Z | 2018-08-25T22:52:30.000Z | tb/test_arbiter.py | nqHITSZ/verilog-axis | 7c6da337b05e5eea675159798aa979f459d89095 | [
"MIT"
] | null | null | null | tb/test_arbiter.py | nqHITSZ/verilog-axis | 7c6da337b05e5eea675159798aa979f459d89095 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify,... | 24.254237 | 77 | 0.574656 |
from myhdl import *
import os
module = 'arbiter'
testbench = 'test_%s' % module
srcs = []
srcs.append("../rtl/%s.v" % module)
srcs.append("../rtl/priority_encoder.v")
srcs.append("%s.v" % testbench)
src = ' '.join(srcs)
build_cmd = "iverilog -o %s.vvp %s" % (testbench, src)
def bench():
PORTS = 32
T... | true | true |
f75aa772e58604d3b204c48a9bbe9895caff17d5 | 11,969 | py | Python | make-map.py | dbaron/rail-network-quizzes | 12e0395cf820cb6842fd2cb50ced321bbbd8e357 | [
"Apache-2.0"
] | null | null | null | make-map.py | dbaron/rail-network-quizzes | 12e0395cf820cb6842fd2cb50ced321bbbd8e357 | [
"Apache-2.0"
] | null | null | null | make-map.py | dbaron/rail-network-quizzes | 12e0395cf820cb6842fd2cb50ced321bbbd8e357 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2020 L. David Baron
#
# 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 la... | 39.63245 | 213 | 0.632133 |
import json
import os.path
import math
import itertools
import re
import unicodedata
from optparse import OptionParser
op = OptionParser()
(options, args) = op.parse_args()
if len(args) != 1:
op.error("expected 1 argument but got {0}".format(len(args)))
network_relation_id = None
try:
network_relation_id = ... | true | true |
f75aa7911fe0ce08a1f761e85a49095397622fd9 | 1,350 | py | Python | techminer2/co_occurrence_matrix_cluster_mds_map.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | techminer2/co_occurrence_matrix_cluster_mds_map.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | techminer2/co_occurrence_matrix_cluster_mds_map.py | jdvelasq/techminer2 | ad64a49402749755798a18417c38a7ad10e83bad | [
"MIT"
] | null | null | null | """
Co-occurrence Matrix / Cluster MDS Map
===============================================================================
>>> from techminer2 import *
>>> directory = "data/"
>>> file_name = "sphinx/images/co_occurrence_matrix_cluster_mds_map.png"
>>> co_occurrence_matrix_cluster_mds_map(
... 'author_keywords',
.... | 22.881356 | 79 | 0.642963 | from sklearn.manifold import MDS
from .co_occurrence_matrix import co_occurrence_matrix
from .network import network
from .network_map import network_map
def co_occurrence_matrix_cluster_mds_map(
column,
min_occ=2,
max_occ=None,
normalization=None,
clustering_method="louvain",
directory="./",... | true | true |
f75aa9e8630eaccc1fa403b8e1703afc0057c2bf | 29,298 | py | Python | azure-devops/azext_devops/vstsCompressed/member_entitlement_management/v4_0/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | null | null | null | azure-devops/azext_devops/vstsCompressed/member_entitlement_management/v4_0/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | 37 | 2020-04-27T07:45:19.000Z | 2021-04-05T07:27:15.000Z | azure-devops/azext_devops/vstsCompressed/member_entitlement_management/v4_0/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"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.
# --------------------------------------------------------------------... | 43.598214 | 287 | 0.675268 |
from msrest.serialization import Model
class AccessLevel(Model):
_attribute_map = {
'account_license_type': {'key': 'accountLicenseType', 'type': 'object'},
'assignment_source': {'key': 'assignmentSource', 'type': 'object'},
'license_display_name': {'key': 'licenseDisplayName', 'type':... | true | true |
f75aa9ee7d666ff9a9accd0f34e1a3fd66f4bef3 | 1,407 | py | Python | ironic/cmd/api.py | dangervon/ironic | 01dd06a17673ec5157dda2ecfc51feb9d2f8e5c2 | [
"Apache-2.0"
] | null | null | null | ironic/cmd/api.py | dangervon/ironic | 01dd06a17673ec5157dda2ecfc51feb9d2f8e5c2 | [
"Apache-2.0"
] | null | null | null | ironic/cmd/api.py | dangervon/ironic | 01dd06a17673ec5157dda2ecfc51feb9d2f8e5c2 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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.a... | 29.93617 | 78 | 0.734897 |
import sys
from oslo_config import cfg
from oslo_log import log
from ironic.common import service as ironic_service
from ironic.common import wsgi_service
CONF = cfg.CONF
LOG = log.getLogger(__name__)
def main():
ironic_service.prepare_service('ironic_api', sys.argv)
ironic_service.ensure_rpc_transp... | true | true |
f75aaa2359e13c4d7b5b5a320db47da32455fe80 | 2,055 | py | Python | legion/cli/legion/cli/main.py | legion-platform/legion | db3a1d99f1005cb881b16af6075a806725123031 | [
"ECL-2.0",
"Apache-2.0"
] | 19 | 2018-05-20T17:06:55.000Z | 2022-01-04T14:15:09.000Z | legion/cli/legion/cli/main.py | legion-platform/legion | db3a1d99f1005cb881b16af6075a806725123031 | [
"ECL-2.0",
"Apache-2.0"
] | 917 | 2018-05-18T18:54:54.000Z | 2021-09-01T10:41:56.000Z | legion/cli/legion/cli/main.py | legion-platform/legion | db3a1d99f1005cb881b16af6075a806725123031 | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2018-07-23T18:09:51.000Z | 2019-08-05T15:37:30.000Z | #
# Copyright 2019 EPAM Systems
#
# 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 a... | 32.109375 | 77 | 0.793674 |
import click
from legion.cli.parsers.config import config_group
from legion.cli.parsers.connection import connection
from legion.cli.parsers.deployment import deployment
from legion.cli.parsers.model import model
from legion.cli.parsers.packaging import packaging
from legion.cli.parsers.packaging_integration import pa... | true | true |
f75aab06d8c37df3e34a7ad2b1fe542cc79c4516 | 129,809 | py | Python | pythonocc/lib/OCC/GeomPlate.py | mbattistello/lambda_converters | 0dfef8927d3ddbc74e5c8ce1c38701ea182a27b3 | [
"MIT"
] | 2 | 2017-10-30T15:51:48.000Z | 2020-11-04T02:23:36.000Z | pythonocc/lib/OCC/GeomPlate.py | mbattistello/lambda_converters | 0dfef8927d3ddbc74e5c8ce1c38701ea182a27b3 | [
"MIT"
] | null | null | null | pythonocc/lib/OCC/GeomPlate.py | mbattistello/lambda_converters | 0dfef8927d3ddbc74e5c8ce1c38701ea182a27b3 | [
"MIT"
] | 4 | 2017-11-29T05:24:34.000Z | 2020-03-05T23:23:23.000Z | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _GeomPla... | 42.104768 | 1,340 | 0.742915 |
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _GeomPlate.SWIG_PyInstanceMethod_New(func)
else:
from new import instancemethod as new_instancemethod
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
imp... | true | true |
f75aab6d4d19a6e9c9dca13b0cb77061bc6e8325 | 5,748 | py | Python | trainer/ml/utils.py | Telcrome/ai-trainer | 54bca3252e194c054bdd3af2b94d6dde940a2a86 | [
"MIT"
] | 1 | 2021-05-05T12:57:42.000Z | 2021-05-05T12:57:42.000Z | trainer/ml/utils.py | Telcrome/ai-trainer | 54bca3252e194c054bdd3af2b94d6dde940a2a86 | [
"MIT"
] | null | null | null | trainer/ml/utils.py | Telcrome/ai-trainer | 54bca3252e194c054bdd3af2b94d6dde940a2a86 | [
"MIT"
] | null | null | null | from enum import Enum
from typing import Generator, Tuple, Iterable, Dict, List
import cv2
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy.ndimage import label, generate_binary_structure
from scipy.ndimage.morphology import distance_transform_edt as dist_trans
import trainer.lib as... | 35.04878 | 117 | 0.636047 | from enum import Enum
from typing import Generator, Tuple, Iterable, Dict, List
import cv2
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy.ndimage import label, generate_binary_structure
from scipy.ndimage.morphology import distance_transform_edt as dist_trans
import trainer.lib as... | true | true |
f75aac38c01575f184f48d848e55a8885563c052 | 68 | py | Python | api/__init__.py | thayannevls/openface-api | 1c537082e4bdd76eef2fe4fd87157c8d4d3550a4 | [
"Apache-2.0"
] | null | null | null | api/__init__.py | thayannevls/openface-api | 1c537082e4bdd76eef2fe4fd87157c8d4d3550a4 | [
"Apache-2.0"
] | 5 | 2018-10-13T17:02:12.000Z | 2018-10-13T17:04:14.000Z | api/__init__.py | thayannevls/HeyYou | 1c537082e4bdd76eef2fe4fd87157c8d4d3550a4 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
app = Flask(__name__)
from api import views | 17 | 23 | 0.794118 | from flask import Flask
app = Flask(__name__)
from api import views | true | true |
f75aace56bd11cd6c9129a90b6f8a0a03ba27900 | 39,084 | py | Python | python/ccxt/bitmex.py | delta-exchange/ccxt | 1d684d4e18311c259ed82677b8d1c5cb3afd99b2 | [
"MIT"
] | 5 | 2019-04-22T15:03:56.000Z | 2019-10-27T13:49:32.000Z | python/ccxt/bitmex.py | delta-exchange/ccxt | 1d684d4e18311c259ed82677b8d1c5cb3afd99b2 | [
"MIT"
] | 5 | 2019-12-28T05:46:26.000Z | 2021-05-08T12:47:41.000Z | python/ccxt/bitmex.py | delta-exchange/ccxt | 1d684d4e18311c259ed82677b8d1c5cb3afd99b2 | [
"MIT"
] | 3 | 2019-06-15T07:21:58.000Z | 2020-06-07T18:24:20.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from cc... | 41.623003 | 126 | 0.450517 |
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import BadRequest
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.b... | true | true |
f75aaf03f95094ce2cc848c409967bf26c4f2ff8 | 2,882 | py | Python | server.py | tgbot-collection/Webhook | ec26826e11f848652c1a8f610d74523805e704d0 | [
"MIT"
] | 1 | 2021-08-06T02:20:40.000Z | 2021-08-06T02:20:40.000Z | server.py | tgbot-collection/Webhook | ec26826e11f848652c1a8f610d74523805e704d0 | [
"MIT"
] | null | null | null | server.py | tgbot-collection/Webhook | ec26826e11f848652c1a8f610d74523805e704d0 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
# coding: utf-8
# Webhook - server.py
# 2/11/21 08:49
#
__author__ = "Benny <benny.think@gmail.com>"
import os
import logging
import json
import subprocess
import requests
import platform
from http import HTTPStatus
from concurrent.futures import ThreadPoolExecutor
from tornado import web, ... | 26.934579 | 113 | 0.651978 |
__author__ = "Benny <benny.think@gmail.com>"
import os
import logging
import json
import subprocess
import requests
import platform
from http import HTTPStatus
from concurrent.futures import ThreadPoolExecutor
from tornado import web, ioloop, httpserver, gen, options
from tornado.log import enable_pretty_logging
f... | true | true |
f75aafaaf8b81ddd7bc61afc69e38511e82eece3 | 931 | py | Python | IncBackups/models.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | IncBackups/models.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | IncBackups/models.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null |
from django.db import models
from websiteFunctions.models import Websites
from datetime import datetime
class IncJob(models.Model):
website = models.ForeignKey(Websites, on_delete=models.CASCADE)
date = models.DateTimeField(default=datetime.now, blank=True)
class JobSnapshots(models.Model):
job = models... | 30.032258 | 67 | 0.764769 |
from django.db import models
from websiteFunctions.models import Websites
from datetime import datetime
class IncJob(models.Model):
website = models.ForeignKey(Websites, on_delete=models.CASCADE)
date = models.DateTimeField(default=datetime.now, blank=True)
class JobSnapshots(models.Model):
job = models... | true | true |
f75aaff7b391e602d7077e90710bfce3fad20712 | 5,110 | py | Python | systemconfig/urls.py | PyFlux/PyFlux | 8abae10261e276bf4942aed8d54ef3b5498754ca | [
"Apache-2.0"
] | null | null | null | systemconfig/urls.py | PyFlux/PyFlux | 8abae10261e276bf4942aed8d54ef3b5498754ca | [
"Apache-2.0"
] | 10 | 2020-03-24T17:09:56.000Z | 2021-12-13T20:00:15.000Z | systemconfig/urls.py | PyFlux/PyFlux-Django-Html | 8abae10261e276bf4942aed8d54ef3b5498754ca | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url, include
from systemconfig.views import *
app_name = 'systemconfig'
urlpatterns = [
url(r'^admin/', include([
url(r'^addcity/', citytown.addCityTown.as_view(), name='city.admin.addcity'),
url(r'^savecity/', citytown.saveCityTown.as_view(), name='city.admin.savecit... | 68.133333 | 120 | 0.702348 | from django.conf.urls import url, include
from systemconfig.views import *
app_name = 'systemconfig'
urlpatterns = [
url(r'^admin/', include([
url(r'^addcity/', citytown.addCityTown.as_view(), name='city.admin.addcity'),
url(r'^savecity/', citytown.saveCityTown.as_view(), name='city.admin.savecit... | true | true |
f75aaff843cea4087fb8bf40aef4e57a0b8c64d5 | 30,158 | py | Python | dogia/wallet/trade_manager.py | dogia-coin/dogia-blockchain | 16ea0a09777354905150c216e1fab60141296473 | [
"Apache-2.0"
] | null | null | null | dogia/wallet/trade_manager.py | dogia-coin/dogia-blockchain | 16ea0a09777354905150c216e1fab60141296473 | [
"Apache-2.0"
] | null | null | null | dogia/wallet/trade_manager.py | dogia-coin/dogia-blockchain | 16ea0a09777354905150c216e1fab60141296473 | [
"Apache-2.0"
] | null | null | null | import logging
import time
import traceback
from pathlib import Path
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Tuple
from blspy import AugSchemeMPL
from dogia.types.blockchain_format.coin import Coin
from dogia.types.blockchain_format.program import Program
from dogia.types.blockch... | 46.254601 | 119 | 0.607434 | import logging
import time
import traceback
from pathlib import Path
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Tuple
from blspy import AugSchemeMPL
from dogia.types.blockchain_format.coin import Coin
from dogia.types.blockchain_format.program import Program
from dogia.types.blockch... | true | true |
f75ab001700e493c72129cea8979c557cc1163dd | 5,051 | py | Python | src/corpus/corpus_segment.py | tiefenauer/forced-alignment | 39fa08e78d4fc2a85fda81b31a320e1b0d2578f0 | [
"MIT"
] | 8 | 2019-03-10T23:22:25.000Z | 2021-12-03T09:30:31.000Z | src/corpus/corpus_segment.py | tiefenauer/forced-alignment | 39fa08e78d4fc2a85fda81b31a320e1b0d2578f0 | [
"MIT"
] | null | null | null | src/corpus/corpus_segment.py | tiefenauer/forced-alignment | 39fa08e78d4fc2a85fda81b31a320e1b0d2578f0 | [
"MIT"
] | 1 | 2019-04-10T05:42:14.000Z | 2019-04-10T05:42:14.000Z | import librosa
import numpy as np
from python_speech_features import mfcc
from corpus.audible import Audible
from util.audio_util import ms_to_frames
from util.string_util import normalize
class Segment(Audible):
"""
Base class for audio segments
"""
# cache features
_mag_specgram = None
_po... | 33.673333 | 117 | 0.653138 | import librosa
import numpy as np
from python_speech_features import mfcc
from corpus.audible import Audible
from util.audio_util import ms_to_frames
from util.string_util import normalize
class Segment(Audible):
_mag_specgram = None
_pow_specgram = None
_mel_specgram = None
_mfcc = None
de... | true | true |
f75ab0bc4f04ecb614011e7f4599989465cab785 | 692 | py | Python | stats_scripts/mpmath/tests/test_identify.py | michalkouril/altanalyze | e721c79c56f7b0022516ff5456ebaa14104c933b | [
"Apache-2.0"
] | 625 | 2015-01-07T04:56:25.000Z | 2022-03-28T16:30:27.000Z | stats_scripts/mpmath/tests/test_identify.py | michalkouril/altanalyze | e721c79c56f7b0022516ff5456ebaa14104c933b | [
"Apache-2.0"
] | 322 | 2015-01-01T15:19:37.000Z | 2022-03-27T05:07:51.000Z | stats_scripts/mpmath/tests/test_identify.py | michalkouril/altanalyze | e721c79c56f7b0022516ff5456ebaa14104c933b | [
"Apache-2.0"
] | 160 | 2015-01-25T01:16:52.000Z | 2022-03-21T14:44:20.000Z | from mpmath import *
def test_pslq():
mp.dps = 15
assert pslq([3*pi+4*e/7, pi, e, log(2)]) == [7, -21, -4, 0]
assert pslq([4.9999999999999991, 1]) == [1, -5]
assert pslq([2,1]) == [1, -2]
def test_identify():
mp.dps = 20
assert identify(zeta(4), ['log(2)', 'pi**4']) == '((1/90)*pi**4)'
mp.... | 34.6 | 69 | 0.495665 | from mpmath import *
def test_pslq():
mp.dps = 15
assert pslq([3*pi+4*e/7, pi, e, log(2)]) == [7, -21, -4, 0]
assert pslq([4.9999999999999991, 1]) == [1, -5]
assert pslq([2,1]) == [1, -2]
def test_identify():
mp.dps = 20
assert identify(zeta(4), ['log(2)', 'pi**4']) == '((1/90)*pi**4)'
mp.... | true | true |
f75ab17817637dc844c051d712a05dc9b58f78e8 | 5,014 | py | Python | tests/test_engine.py | robertpro/async_gui | df0fcf1a44c693860f1ae57d9d3bcc1541aec1b8 | [
"BSD-2-Clause"
] | 2 | 2019-01-30T14:19:54.000Z | 2020-04-28T17:41:22.000Z | tests/test_engine.py | robertpro/async_gui | df0fcf1a44c693860f1ae57d9d3bcc1541aec1b8 | [
"BSD-2-Clause"
] | null | null | null | tests/test_engine.py | robertpro/async_gui | df0fcf1a44c693860f1ae57d9d3bcc1541aec1b8 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import unittest
import time
from async_gui.compat import thread
import multiprocessing
from async_gui.engine import return_result, Engine
#from async_gui.toolkits.pyqt import PyQtEngine as Engine
engine = En... | 29.845238 | 74 | 0.610092 | import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import unittest
import time
from async_gui.compat import thread
import multiprocessing
from async_gui.engine import return_result, Engine
engine = Engine()
asynchronous = engine.asynchronous
class EngineTestCase(unittest.TestCase):
from async_gui... | true | true |
f75ab1d2f15cc587462887f1cee9569b7b3bdaf8 | 35,899 | py | Python | IMU/fed.py | sxontheway/BalanceFL | 43bb7539c932b7b6f7ad03f94a724452ae3855a3 | [
"MIT"
] | null | null | null | IMU/fed.py | sxontheway/BalanceFL | 43bb7539c932b7b6f7ad03f94a724452ae3855a3 | [
"MIT"
] | null | null | null | IMU/fed.py | sxontheway/BalanceFL | 43bb7539c932b7b6f7ad03f94a724452ae3855a3 | [
"MIT"
] | null | null | null | import copy
import time
from collections import OrderedDict
import torch
from data.dataloader import local_client_dataset, test_dataset
from models.utils import *
from utils.train_helper import validate_one_model
from utils.sampling import *
import numpy as np
from multiprocessing import Process
import time
def re... | 40.200448 | 168 | 0.517953 | import copy
import time
from collections import OrderedDict
import torch
from data.dataloader import local_client_dataset, test_dataset
from models.utils import *
from utils.train_helper import validate_one_model
from utils.sampling import *
import numpy as np
from multiprocessing import Process
import time
def re... | true | true |
f75ab2b005175fe064405a03e83bc2805fc3a3f4 | 213,143 | py | Python | Moudle/Weblogic/CVE_2019_2725.py | WingsSec/Meppo | 454aa6ce6cc3e93cadb2dc0c455c56fa5e0f1a94 | [
"MIT"
] | 60 | 2022-03-22T02:40:41.000Z | 2022-03-29T06:23:57.000Z | Moudle/Weblogic/CVE_2019_2725.py | BambooLove/Meppo | 96e023c0b07c09f334b44fcfb9abfe741a082f0f | [
"MIT"
] | null | null | null | Moudle/Weblogic/CVE_2019_2725.py | BambooLove/Meppo | 96e023c0b07c09f334b44fcfb9abfe741a082f0f | [
"MIT"
] | 9 | 2022-03-22T12:10:44.000Z | 2022-03-25T07:37:01.000Z | #!/usr/bin/env python3
# _*_ coding:utf-8 _*_
import requests
# 脚本信息
######################################################
NAME='CVE_2019_2725'
AUTHOR="RabbitMask"
REMARK='Weblogic RCE'
FOFA_RULE='app="Oracle-BEA-WebLogic-Server"'
######################################################
VUL = ['CVE-2019-2725']
de... | 1,761.512397 | 205,601 | 0.657864 |
import requests
NAME='CVE_2019_2725'
AUTHOR="RabbitMask"
REMARK='Weblogic RCE'
FOFA_RULE='app="Oracle-BEA-WebLogic-Server"'
VUL = ['CVE-2019-2725']
def weblogic_10_3_6(ip):
headers = {
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8",
"User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_... | true | true |
f75ab3a23018bed5140780a01791999185820b7d | 239 | py | Python | pdfannots.py | ajdavis/pdfannots | dbdfefa158971e1746fae2da139918e9f59439ea | [
"MIT"
] | 265 | 2017-03-10T18:45:30.000Z | 2022-03-30T09:50:07.000Z | pdfannots.py | ajdavis/pdfannots | dbdfefa158971e1746fae2da139918e9f59439ea | [
"MIT"
] | 48 | 2017-05-15T21:19:29.000Z | 2022-01-30T01:02:39.000Z | pdfannots.py | ajdavis/pdfannots | dbdfefa158971e1746fae2da139918e9f59439ea | [
"MIT"
] | 77 | 2017-05-15T20:59:37.000Z | 2022-03-19T08:29:54.000Z | #!/usr/bin/env python3
# This script, which is not part of the pdfannots package, allows pdfannots
# to by run directly from a source tree clone.
import sys
from pdfannots.cli import main
if __name__ == '__main__':
sys.exit(main())
| 21.727273 | 75 | 0.732218 |
import sys
from pdfannots.cli import main
if __name__ == '__main__':
sys.exit(main())
| true | true |
f75ab65a54dd3c4b9f776fec5364c567a0b861e2 | 1,366 | py | Python | flash/text/seq2seq/core/finetuning.py | Darktex/lightning-flash | 2a3e4c779e1887a72da0401206fbf801c36f252f | [
"Apache-2.0"
] | 2 | 2021-05-25T20:06:10.000Z | 2022-02-13T22:08:59.000Z | flash/text/seq2seq/core/finetuning.py | Darktex/lightning-flash | 2a3e4c779e1887a72da0401206fbf801c36f252f | [
"Apache-2.0"
] | 1 | 2021-06-16T14:46:06.000Z | 2021-06-16T14:46:06.000Z | flash/text/seq2seq/core/finetuning.py | Darktex/lightning-flash | 2a3e4c779e1887a72da0401206fbf801c36f252f | [
"Apache-2.0"
] | 3 | 2021-06-03T10:03:04.000Z | 2021-08-08T21:49:16.000Z | # Copyright The PyTorch Lightning team.
#
# 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 i... | 40.176471 | 76 | 0.72328 | import pytorch_lightning as pl
from flash.core.finetuning import FlashBaseFinetuning
class Seq2SeqFreezeEmbeddings(FlashBaseFinetuning):
def __init__(self, model_type: str, train_bn: bool = True):
super().__init__("", train_bn)
self.model_type = model_type
def freeze_before_training(self, p... | true | true |
f75ab961b3eb99af30897baab7b8c091e6b1d3ec | 929 | py | Python | plugins/holland.backup.random/setup.py | Alibloke/holland | e630b511a95ed8e36205e8300e632018918223ff | [
"BSD-3-Clause"
] | null | null | null | plugins/holland.backup.random/setup.py | Alibloke/holland | e630b511a95ed8e36205e8300e632018918223ff | [
"BSD-3-Clause"
] | null | null | null | plugins/holland.backup.random/setup.py | Alibloke/holland | e630b511a95ed8e36205e8300e632018918223ff | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
version = "1.2.0"
setup(
name="holland.backup.random",
version=version,
description="Back up data from /dev/random",
long_description="""\
Uses /dev/random. A bit more of an example then holland.backup.example
""",
classifiers=[], # Get stri... | 29.967742 | 94 | 0.65662 | from setuptools import setup, find_packages
version = "1.2.0"
setup(
name="holland.backup.random",
version=version,
description="Back up data from /dev/random",
long_description="""\
Uses /dev/random. A bit more of an example then holland.backup.example
""",
classifiers=[], keywor... | true | true |
f75ab961b4ac3b03feb34735aa9085d7023d5b56 | 9,742 | py | Python | litedram/core/crossbar.py | DaveRichmond/litedram | 8c112c709c0eeb3a79d2696e168becb9d1d4d8c8 | [
"OLDAP-2.6",
"OLDAP-2.3",
"OLDAP-2.7"
] | null | null | null | litedram/core/crossbar.py | DaveRichmond/litedram | 8c112c709c0eeb3a79d2696e168becb9d1d4d8c8 | [
"OLDAP-2.6",
"OLDAP-2.3",
"OLDAP-2.7"
] | null | null | null | litedram/core/crossbar.py | DaveRichmond/litedram | 8c112c709c0eeb3a79d2696e168becb9d1d4d8c8 | [
"OLDAP-2.6",
"OLDAP-2.3",
"OLDAP-2.7"
] | null | null | null | # This file is Copyright (c) 2015 Sebastien Bourdeauducq <sb@m-labs.hk>
# This file is Copyright (c) 2016-2019 Florent Kermarrec <florent@enjoy-digital.fr>
# This file is Copyright (c) 2018 John Sully <john@csquare.ca>
# License: BSD
"""LiteDRAM Crossbar."""
from functools import reduce
from operator import or_
from... | 46.170616 | 110 | 0.588483 |
from functools import reduce
from operator import or_
from migen import *
from migen.genlib import roundrobin
from litex.soc.interconnect import stream
from litedram.common import *
from litedram.core.controller import *
from litedram.frontend.adaptation import *
class LiteDRAMCrossbar(Module):
def __init__(... | true | true |
f75ab9667565d4d1ec2ff22ce2d86604412a3a05 | 1,295 | py | Python | nicos_mlz/stressi/setups/eulerian_huber.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/stressi/setups/eulerian_huber.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_mlz/stressi/setups/eulerian_huber.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | description = 'STRESS-SPEC setup with Huber Eulerian cradle'
group = 'basic'
includes = [
'standard',
'sampletable',
]
sysconfig = dict(
datasinks = ['caresssink'],
)
tango_base = 'tango://motorbox06.stressi.frm2.tum.de:10000/box/'
devices = dict(
chis_m = device('nicos.devices.tango.Motor',
... | 25.392157 | 64 | 0.569884 | description = 'STRESS-SPEC setup with Huber Eulerian cradle'
group = 'basic'
includes = [
'standard',
'sampletable',
]
sysconfig = dict(
datasinks = ['caresssink'],
)
tango_base = 'tango://motorbox06.stressi.frm2.tum.de:10000/box/'
devices = dict(
chis_m = device('nicos.devices.tango.Motor',
... | true | true |
f75abb11eec2bcbc6aa2e3278d178aec45c7822c | 988 | py | Python | youtube_sync/login.py | abhayagiri/youtube-sync | ce3861f1b0c1448b1d48e5ba17925f5c082f04a2 | [
"MIT"
] | null | null | null | youtube_sync/login.py | abhayagiri/youtube-sync | ce3861f1b0c1448b1d48e5ba17925f5c082f04a2 | [
"MIT"
] | null | null | null | youtube_sync/login.py | abhayagiri/youtube-sync | ce3861f1b0c1448b1d48e5ba17925f5c082f04a2 | [
"MIT"
] | null | null | null | import flask
import flask_login
from . import app
class User(flask_login.UserMixin):
def __init__(self):
self.id = 'admin'
login_manager = flask_login.LoginManager()
login_manager.login_view = "login"
login_manager.init_app(app)
@login_manager.user_loader
def load_user(user_id):
return User()
@... | 23.52381 | 57 | 0.65081 | import flask
import flask_login
from . import app
class User(flask_login.UserMixin):
def __init__(self):
self.id = 'admin'
login_manager = flask_login.LoginManager()
login_manager.login_view = "login"
login_manager.init_app(app)
@login_manager.user_loader
def load_user(user_id):
return User()
@... | true | true |
f75abb70fc6e4c96595753be1b2c33c6fc711222 | 303 | py | Python | main.py | vietnamican/easy_pydrive | 342ad560d842a61ae8865c40f242715e8335dc80 | [
"MIT"
] | null | null | null | main.py | vietnamican/easy_pydrive | 342ad560d842a61ae8865c40f242715e8335dc80 | [
"MIT"
] | null | null | null | main.py | vietnamican/easy_pydrive | 342ad560d842a61ae8865c40f242715e8335dc80 | [
"MIT"
] | null | null | null | from time import sleep
from auth import get_drive_instance
from api import list_dir, check_files_exist, up_folder
drive = get_drive_instance()
parent_id = "1Bkoka3pDX60O3oqFKv0P85oiN1SmDpSZ"
# check_files_exist(drive, [1], parent_id)
up_folder(drive, 'folder_a', parent_id, up_mode=1, recursive=True) | 30.3 | 66 | 0.815182 | from time import sleep
from auth import get_drive_instance
from api import list_dir, check_files_exist, up_folder
drive = get_drive_instance()
parent_id = "1Bkoka3pDX60O3oqFKv0P85oiN1SmDpSZ"
up_folder(drive, 'folder_a', parent_id, up_mode=1, recursive=True) | true | true |
f75abc3841461281524e0736e503dbcae5901e3d | 5,690 | py | Python | openstack_dashboard/dashboards/identity/identity_providers/views.py | hashsos/hashcloudos-horizon | 0cc080ca6777e4a1dac5cbcc6143202baddab176 | [
"Apache-2.0"
] | 37 | 2018-10-30T02:47:24.000Z | 2021-12-04T10:29:40.000Z | openstack_dashboard/dashboards/identity/identity_providers/views.py | hashsos/hashcloudos-horizon | 0cc080ca6777e4a1dac5cbcc6143202baddab176 | [
"Apache-2.0"
] | 106 | 2019-01-18T03:06:55.000Z | 2019-11-29T05:06:18.000Z | openstack_dashboard/dashboards/identity/identity_providers/views.py | hashsos/hashcloudos-horizon | 0cc080ca6777e4a1dac5cbcc6143202baddab176 | [
"Apache-2.0"
] | 35 | 2018-11-26T03:36:31.000Z | 2021-12-04T10:29:41.000Z | # Copyright (C) 2015 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 38.707483 | 77 | 0.660105 |
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from horizon import tables
from horizon import tabs
from horizon.utils import mem... | true | true |
f75abc56bc18be718b3c845c735ea1f4b7e0ac92 | 6,608 | py | Python | convlab2/dst/sumbt/multiwoz_zh/convert_to_glue_format.py | nikitacs16/ConvLab-2 | 5bd4c6154957ac9c5a28db151b4724431355b258 | [
"Apache-2.0"
] | null | null | null | convlab2/dst/sumbt/multiwoz_zh/convert_to_glue_format.py | nikitacs16/ConvLab-2 | 5bd4c6154957ac9c5a28db151b4724431355b258 | [
"Apache-2.0"
] | null | null | null | convlab2/dst/sumbt/multiwoz_zh/convert_to_glue_format.py | nikitacs16/ConvLab-2 | 5bd4c6154957ac9c5a28db151b4724431355b258 | [
"Apache-2.0"
] | null | null | null | import json
import zipfile
#from convlab2.dst.sumbt.multiwoz_zh.sumbt_config import *
import os
def trans_value(value):
trans = {
"": '未提及',
'没有提到': '未提及',
'没有': '未提及',
'未提到': '未提及',
'一个也没有': '未提及',
'无': '未提及',
'是的': '有',
'不是': '没有',
'不关心': '不在... | 41.559748 | 126 | 0.47957 | import json
import zipfile
import os
def trans_value(value):
trans = {
"": '未提及',
'没有提到': '未提及',
'没有': '未提及',
'未提到': '未提及',
'一个也没有': '未提及',
'无': '未提及',
'是的': '有',
'不是': '没有',
'不关心': '不在意',
'不在乎': '不在意',
}
return trans.get(value... | true | true |
f75abc79c60846a2d75beb78de94f1d97f069eb6 | 1,167 | py | Python | 4_Lambda_Map_Reduce_Filter/map_reduce_filter.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | 1 | 2022-03-02T07:16:30.000Z | 2022-03-02T07:16:30.000Z | 4_Lambda_Map_Reduce_Filter/map_reduce_filter.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | 4_Lambda_Map_Reduce_Filter/map_reduce_filter.py | felixdittrich92/Python3 | 16b767465e4bdf0adc652c195d15384bb9faa4cf | [
"MIT"
] | null | null | null | import functools
# Python 'map' function takes:
# Mapping from N values to N values
# 1.) a function (callable)
# 2.) variable number of iterables
print("----------Map N -> N----------")
my_list = [1, 2, 3]
def square_value(val):
return val**2
my_list_squared = list(map(square_value, my_list))
print(my_list_sq... | 23.816327 | 78 | 0.658955 | import functools
print("----------Map N -> N----------")
my_list = [1, 2, 3]
def square_value(val):
return val**2
my_list_squared = list(map(square_value, my_list))
print(my_list_squared)
my_vector1 = [1, 2, 3]
my_vector2 = [-1, 4, 0]
my_result = list(map(lambda x, y: x * y, my_vector1, my_vector2))
print(my... | true | true |
f75abfbd6fb8e2f045f62cd4732fe707e3ee04d2 | 1,049 | py | Python | src/picbed.py | huoshuaibing/picbed | b53f9f0de9c227c69f8065a28c73d00833e90b5f | [
"BSD-3-Clause"
] | 1 | 2020-11-20T08:49:51.000Z | 2020-11-20T08:49:51.000Z | src/picbed.py | huoshuaibing/picbed | b53f9f0de9c227c69f8065a28c73d00833e90b5f | [
"BSD-3-Clause"
] | null | null | null | src/picbed.py | huoshuaibing/picbed | b53f9f0de9c227c69f8065a28c73d00833e90b5f | [
"BSD-3-Clause"
] | null | null | null | # picbed gunicorn config
from os.path import abspath, dirname, join, exists, isdir
from os import getenv, mkdir
from multiprocessing import cpu_count
from config import GLOBAL
def delete_hookloadtime():
from libs.storage import get_storage
s = get_storage()
del s['hookloadtime']
IS_RUN = True if getenv... | 21.854167 | 67 | 0.699714 |
from os.path import abspath, dirname, join, exists, isdir
from os import getenv, mkdir
from multiprocessing import cpu_count
from config import GLOBAL
def delete_hookloadtime():
from libs.storage import get_storage
s = get_storage()
del s['hookloadtime']
IS_RUN = True if getenv("picbed_isrun") == "true... | true | true |
f75ac0b303a30daf0164bc274bec8d13fe963562 | 2,813 | py | Python | examples/baidu_index.py | alphardex/looter | 2be094576e31fd13123719ca94e42cb31475dffa | [
"MIT"
] | 145 | 2018-02-25T13:59:52.000Z | 2021-12-11T17:13:36.000Z | examples/baidu_index.py | alphardex/crawltools | 2be094576e31fd13123719ca94e42cb31475dffa | [
"MIT"
] | 7 | 2018-03-26T01:53:44.000Z | 2021-03-31T18:59:12.000Z | examples/baidu_index.py | alphardex/crawltools | 2be094576e31fd13123719ca94e42cb31475dffa | [
"MIT"
] | 25 | 2018-03-26T14:16:53.000Z | 2021-10-14T12:32:21.000Z | """
爬取百度指数的某一时间段内的特定关键词的所有指数
"""
import time
import looter as lt
import requests
import pandas as pd
import arrow
from loguru import logger
words = [] # 关键词列表
start_date = '2018-01-29'
end_date = '2018-12-31'
kinds = ['all', 'pc', 'wise']
domain = 'http://index.baidu.com'
headers = {
'Host':
'index.baidu.com'... | 37.506667 | 657 | 0.652328 | import time
import looter as lt
import requests
import pandas as pd
import arrow
from loguru import logger
words = [] start_date = '2018-01-29'
end_date = '2018-12-31'
kinds = ['all', 'pc', 'wise']
domain = 'http://index.baidu.com'
headers = {
'Host':
'index.baidu.com',
'Connection':
'keep-alive',
... | true | true |
f75ac11b8e923ae63e7ff8a837e7f82063fc54ab | 625 | py | Python | 3M/W4/4.py | allenalvin333/Hackerrank_Prep | 26ed5b874daba4775d006824d36f9e82ea5ff1ea | [
"MIT"
] | 2 | 2021-11-25T13:38:36.000Z | 2021-11-25T13:42:56.000Z | 3M/W4/4.py | allenalvin333/Hackerrank_Prep | 26ed5b874daba4775d006824d36f9e82ea5ff1ea | [
"MIT"
] | null | null | null | 3M/W4/4.py | allenalvin333/Hackerrank_Prep | 26ed5b874daba4775d006824d36f9e82ea5ff1ea | [
"MIT"
] | 1 | 2021-11-25T13:38:43.000Z | 2021-11-25T13:38:43.000Z | # https://www.hackerrank.com/challenges/three-month-preparation-kit-separate-the-numbers/problem
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'separateNumbers' function below.
#
# The function accepts STRING s as parameter.
#
def separateNumbers(s):
for z in range(1, ... | 20.16129 | 96 | 0.6 |
import math
import os
import random
import re
import sys
def separateNumbers(s):
for z in range(1, len(s)//2+1):
a,b = s[:z],int(s[:z])
while a in s:
a,b = a+str(b+1),b+1
if(a==s): return 'YES '+s[:z]
return 'NO'
if __name__ == '__main__':
q = int(input()... | true | true |
f75ac25dac429318eb911f4ed669775a2633e977 | 2,354 | py | Python | spacy_transformers/tests/test_alignment.py | thomashacker/spacy-transformers | 5a36943fccb66b5e7c7c2079b1b90ff9b2f9d020 | [
"MIT"
] | 744 | 2019-10-08T14:33:45.000Z | 2022-03-25T21:30:26.000Z | spacy_transformers/tests/test_alignment.py | thomashacker/spacy-transformers | 5a36943fccb66b5e7c7c2079b1b90ff9b2f9d020 | [
"MIT"
] | 176 | 2019-10-08T13:54:29.000Z | 2021-10-05T13:57:02.000Z | spacy_transformers/tests/test_alignment.py | thomashacker/spacy-transformers | 5a36943fccb66b5e7c7c2079b1b90ff9b2f9d020 | [
"MIT"
] | 110 | 2019-10-09T06:28:03.000Z | 2022-03-24T06:03:35.000Z | import pytest
from typing import List
from spacy.tokens import Doc
from spacy.vocab import Vocab
from thinc.api import NumpyOps
from thinc.types import Ragged
from ..align import get_alignment, apply_alignment
def get_ragged(ops, nested: List[List[int]]):
nested = [ops.asarray(x) for x in nested]
return Ragge... | 29.061728 | 77 | 0.581563 | import pytest
from typing import List
from spacy.tokens import Doc
from spacy.vocab import Vocab
from thinc.api import NumpyOps
from thinc.types import Ragged
from ..align import get_alignment, apply_alignment
def get_ragged(ops, nested: List[List[int]]):
nested = [ops.asarray(x) for x in nested]
return Ragge... | true | true |
f75ac355dc1bd035c1f7dd7f7adc0610f7f7646e | 48,558 | py | Python | x2paddle/op_mapper/dygraph/caffe2paddle/caffe_op_mapper.py | aiyasin/X2Paddle | b37959f2ecdc09fdec7a38c01272126a7f3800e4 | [
"Apache-2.0"
] | null | null | null | x2paddle/op_mapper/dygraph/caffe2paddle/caffe_op_mapper.py | aiyasin/X2Paddle | b37959f2ecdc09fdec7a38c01272126a7f3800e4 | [
"Apache-2.0"
] | null | null | null | x2paddle/op_mapper/dygraph/caffe2paddle/caffe_op_mapper.py | aiyasin/X2Paddle | b37959f2ecdc09fdec7a38c01272126a7f3800e4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 39.866995 | 153 | 0.54716 |
import sys
import numbers
import numpy as np
from x2paddle.core.op_mapper import OpMapper
from x2paddle.core.util import *
from x2paddle.core.program import PaddleGraph
from x2paddle.decoder.caffe_decoder import CaffeGraphNode
def _adjust_parameters(node):
data = node.data
data = list(da... | true | true |
f75ac4bb0c201d0b84629426412e7bf22b0987b7 | 3,463 | py | Python | IRIS_data_download/IRIS_download_support/obspy/core/util/libnames.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/core/util/libnames.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/core/util/libnames.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | # -*- coding: utf-8 -*-
"""
Library name handling for ObsPy.
:copyright:
The ObsPy Development Team (devs@obspy.org)
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
# NO IMPORTS FROM OBSPY OR FUTURE IN THIS FILE! (file gets used at
# installation time)
... | 33.298077 | 79 | 0.650592 | import ctypes
import os
import platform
import re
import warnings
from distutils import sysconfig
def cleanse_pymodule_filename(filename):
filename = re.sub(r'^[^a-zA-Z_]', "_", filename)
filename = re.sub(r'[^a-zA-Z0-9_]', "_", filename)
return filename
def _get_lib_name(lib, add_extension_suffix):
... | true | true |
f75ac5173e87f098e06de722e7448bdfb1f092d2 | 90,561 | py | Python | google/cloud/talent/v4beta1/talent-v4beta1-py/tests/unit/gapic/talent_v4beta1/test_tenant_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/talent/v4beta1/talent-v4beta1-py/tests/unit/gapic/talent_v4beta1/test_tenant_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/talent/v4beta1/talent-v4beta1-py/tests/unit/gapic/talent_v4beta1/test_tenant_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google 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
#
# Unless required by applicable law or... | 38.179174 | 236 | 0.679244 | import os
import mock
import packaging.version
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import gap... | true | true |
f75ac649da625bc5ac1209f4dfc3319175ac7d4e | 1,810 | py | Python | packages/mcni/tests/mcni/components/NeutronFromStorage_mpi_TestCase.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 5 | 2017-01-16T03:59:47.000Z | 2020-06-23T02:54:19.000Z | packages/mcni/tests/mcni/components/NeutronFromStorage_mpi_TestCase.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 293 | 2015-10-29T17:45:52.000Z | 2022-01-07T16:31:09.000Z | packages/mcni/tests/mcni/components/NeutronFromStorage_mpi_TestCase.py | mcvine/mcvine | 42232534b0c6af729628009bed165cd7d833789d | [
"BSD-3-Clause"
] | 1 | 2019-05-25T00:53:31.000Z | 2019-05-25T00:53:31.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Jiao Lin
# California Institute of Technology
# (C) 2007-2010 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 22.073171 | 95 | 0.583978 |
skip = 1
needmpi = 1
import unittestX as unittest
import journal
debug = journal.debug( "mcni.components.test" )
warning = journal.warning( "mcni.components.test" )
class TestCase(unittest.TestCase):
def test1(self):
from mcni.components.NeutronFromStorage import NeutronFromStorage
comp =... | true | true |
f75ac6b6ecb196e1b0e3079187bf96262068a810 | 710 | py | Python | linearmodels/tests/test_tester.py | clarityai-eng/linearmodels | 21d059199925b51075ac2139e6d8ab44fdd17938 | [
"NCSA"
] | null | null | null | linearmodels/tests/test_tester.py | clarityai-eng/linearmodels | 21d059199925b51075ac2139e6d8ab44fdd17938 | [
"NCSA"
] | null | null | null | linearmodels/tests/test_tester.py | clarityai-eng/linearmodels | 21d059199925b51075ac2139e6d8ab44fdd17938 | [
"NCSA"
] | null | null | null | import pytest
import linearmodels
def test_runner():
status = linearmodels.test(
location="tests/shared/test_typed_getters.py", exit=False
)
assert status == 0
def test_runner_exception():
with pytest.raises(RuntimeError):
linearmodels.test(location="tests/shared/unknown_test_file.p... | 19.722222 | 71 | 0.629577 | import pytest
import linearmodels
def test_runner():
status = linearmodels.test(
location="tests/shared/test_typed_getters.py", exit=False
)
assert status == 0
def test_runner_exception():
with pytest.raises(RuntimeError):
linearmodels.test(location="tests/shared/unknown_test_file.p... | true | true |
f75ac6e3219a9595c012c071d3e8a61da8e64da0 | 2,118 | py | Python | code/Chapter_9.py | arifmudi/Natural-Language-Processing-and-Computational-Linguistics | 585315fd199b4cb54b51b10909ac04a5e38629ec | [
"MIT"
] | 52 | 2018-06-15T07:48:40.000Z | 2022-03-06T22:12:35.000Z | code/Chapter_9.py | arifmudi/Natural-Language-Processing-and-Computational-Linguistics | 585315fd199b4cb54b51b10909ac04a5e38629ec | [
"MIT"
] | null | null | null | code/Chapter_9.py | arifmudi/Natural-Language-Processing-and-Computational-Linguistics | 585315fd199b4cb54b51b10909ac04a5e38629ec | [
"MIT"
] | 49 | 2018-07-05T04:16:53.000Z | 2022-03-17T09:50:56.000Z | # pre-processing tips
# adding stop words in spacy
# remember to load your appropriate language model
my_stop_words = [u'say', u'\'s', u'Mr', u'be', u'said', u'says', u'saying']
for stopword in my_stop_words:
lexeme = nlp.vocab[stopword]
lexeme.is_stop = True
# adding logging
import logging
logging.basicCon... | 31.61194 | 115 | 0.68508 |
my_stop_words = [u'say', u'\'s', u'Mr', u'be', u'said', u'says', u'saying']
for stopword in my_stop_words:
lexeme = nlp.vocab[stopword]
lexeme.is_stop = True
# adding logging
import logging
logging.basicConfig(filename='logfile.log', format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
... | true | true |
f75ac96f9e5bf69c56dd246fa18bd530361c4ed5 | 158 | py | Python | CodeWars/7 Kyu/Batman Quotes.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Batman Quotes.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Batman Quotes.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | class BatmanQuotes(object):
def get_quote(quotes, hero):
return f"{('Batman', 'Joker', 'Robin')['BJR'.index(hero[0])]}: {quotes[int(min(hero))]}" | 39.5 | 96 | 0.613924 | class BatmanQuotes(object):
def get_quote(quotes, hero):
return f"{('Batman', 'Joker', 'Robin')['BJR'.index(hero[0])]}: {quotes[int(min(hero))]}" | true | true |
f75aca1c623582f523b427e69b77ec5e2e9cafce | 9,377 | py | Python | devito/passes/iet/mpi.py | YanivHollander/devito | 81feda266b685207e5ba01dee29c9173e940876c | [
"MIT"
] | 1 | 2020-06-08T20:44:35.000Z | 2020-06-08T20:44:35.000Z | devito/passes/iet/mpi.py | FabioLuporini/devito | 0c019a7034e862bb5e7dd255c7e3306e38925607 | [
"MIT"
] | 3 | 2020-11-30T05:38:22.000Z | 2022-03-07T14:02:05.000Z | devito/passes/iet/mpi.py | FabioLuporini/devito | 0c019a7034e862bb5e7dd255c7e3306e38925607 | [
"MIT"
] | 1 | 2021-01-05T07:27:35.000Z | 2021-01-05T07:27:35.000Z | from collections import defaultdict
from sympy import S
from devito.ir.iet import (Call, Expression, HaloSpot, Iteration, FindNodes,
MapNodes, Transformer, retrieve_iteration_tree)
from devito.ir.support import PARALLEL, Scope
from devito.mpi import HaloExchangeBuilder, HaloScheme
from devi... | 34.988806 | 89 | 0.596566 | from collections import defaultdict
from sympy import S
from devito.ir.iet import (Call, Expression, HaloSpot, Iteration, FindNodes,
MapNodes, Transformer, retrieve_iteration_tree)
from devito.ir.support import PARALLEL, Scope
from devito.mpi import HaloExchangeBuilder, HaloScheme
from devi... | true | true |
f75aca2cad5c0717059f137d00dbe845c9ba399f | 655 | py | Python | www/cursivedata/admin.py | mattvenn/cursivedata | 43e43263bef6f01698166d87bcff00b246957277 | [
"CC-BY-4.0"
] | 1 | 2015-12-31T01:46:09.000Z | 2015-12-31T01:46:09.000Z | www/cursivedata/admin.py | mattvenn/cursivedata | 43e43263bef6f01698166d87bcff00b246957277 | [
"CC-BY-4.0"
] | 5 | 2015-04-06T19:15:15.000Z | 2015-07-25T21:45:16.000Z | www/cursivedata/admin.py | mattvenn/cursivedata | 43e43263bef6f01698166d87bcff00b246957277 | [
"CC-BY-4.0"
] | null | null | null | from django.contrib import admin
from cursivedata.models import *
admin.site.register(DataStore)
admin.site.register(GeneratorState)
admin.site.register(Endpoint)
admin.site.register(COSMSource)
class ParameterInline(admin.TabularInline):
model = Parameter
class GeneratorAdmin(admin.ModelAdmin):
inlines = [
... | 27.291667 | 150 | 0.767939 | from django.contrib import admin
from cursivedata.models import *
admin.site.register(DataStore)
admin.site.register(GeneratorState)
admin.site.register(Endpoint)
admin.site.register(COSMSource)
class ParameterInline(admin.TabularInline):
model = Parameter
class GeneratorAdmin(admin.ModelAdmin):
inlines = [
... | true | true |
f75acac0d21b80fe4608cdf62ca2d064fc7edbf4 | 7,755 | py | Python | tutorial_english/4_transform.py | SymonSaroar/manim | 9f1112474fedb67c061852720ee75234d785a0ec | [
"MIT"
] | 2 | 2020-12-26T05:21:23.000Z | 2022-02-22T23:00:28.000Z | from_wjl/tutorial_english/tutorial/4_transform.py | wwjll/Manim-Chamber | 3d1b186bd111e6297607ba31eba73465fb7d6229 | [
"MIT"
] | null | null | null | from_wjl/tutorial_english/tutorial/4_transform.py | wwjll/Manim-Chamber | 3d1b186bd111e6297607ba31eba73465fb7d6229 | [
"MIT"
] | null | null | null | from big_ol_pile_of_manim_imports import *
class TransformationText1V1(Scene):
def construct(self):
texto1 = TextMobject("First text")
texto2 = TextMobject("Second text")
self.play(Write(texto1))
self.wait()
self.play(Transform(texto1,texto2))
self.wait()
class TransformationText1V2(Scene):
def construc... | 22.808824 | 66 | 0.594197 | from big_ol_pile_of_manim_imports import *
class TransformationText1V1(Scene):
def construct(self):
texto1 = TextMobject("First text")
texto2 = TextMobject("Second text")
self.play(Write(texto1))
self.wait()
self.play(Transform(texto1,texto2))
self.wait()
class TransformationText1V2(Scene):
def construc... | true | true |
f75acaebf9b0ee9e063be4711353ddc63935898c | 1,268 | py | Python | scripts/examples/MJO/plot_phases_DWT_probs.py | teslakit/teslak | 3f3dda08c5c5998cb2a7debbf22f2be675a4ff8b | [
"MIT"
] | 12 | 2019-11-14T22:19:12.000Z | 2022-03-04T01:25:33.000Z | scripts/examples/MJO/plot_phases_DWT_probs.py | anderdyl/teslaCoSMoS | 1495bfa2364ddbacb802d145b456a35213abfb7c | [
"MIT"
] | 5 | 2020-03-24T18:21:41.000Z | 2021-08-23T20:39:43.000Z | scripts/examples/MJO/plot_phases_DWT_probs.py | anderdyl/teslaCoSMoS | 1495bfa2364ddbacb802d145b456a35213abfb7c | [
"MIT"
] | 2 | 2021-03-06T07:54:41.000Z | 2021-06-30T14:33:22.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# common
import os
import os.path as op
import sys
# pip
import numpy as np
import xarray as xr
# DEV: override installed teslakit
import sys
sys.path.insert(0, op.join(op.dirname(__file__), '..', '..', '..'))
# teslakit
from teslakit.database import Database
from tesla... | 21.862069 | 67 | 0.709779 |
import os
import os.path as op
import sys
import numpy as np
import xarray as xr
import sys
sys.path.insert(0, op.join(op.dirname(__file__), '..', '..', '..'))
from teslakit.database import Database
from teslakit.plotting.wts import Plot_Probs_WT_WT
p_data = r'/Users/nico/Projects/TESLA-kit/TeslaKit/data'
db = D... | true | true |
f75acaed672dae4123ad3009aa6aa05363c5dba9 | 158 | py | Python | server.py | jerrykan/python-livereload | ecabebaeee2a40743f5a8216e1856c9f9150913f | [
"BSD-3-Clause"
] | null | null | null | server.py | jerrykan/python-livereload | ecabebaeee2a40743f5a8216e1856c9f9150913f | [
"BSD-3-Clause"
] | null | null | null | server.py | jerrykan/python-livereload | ecabebaeee2a40743f5a8216e1856c9f9150913f | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
from livereload import Server, shell
server = Server()
server.watch('docs/*.rst', shell('make html'))
server.serve(root='docs/_build/html')
| 19.75 | 46 | 0.71519 |
from livereload import Server, shell
server = Server()
server.watch('docs/*.rst', shell('make html'))
server.serve(root='docs/_build/html')
| true | true |
f75acb29eb0a349943e57cb394bee746566d2e83 | 974 | py | Python | CommonTools/Loggers/SlackNotifications.py | AdamSwenson/TwitterProject | 8c5dc7a57eac611b555058736d609f2f204cb836 | [
"MIT"
] | null | null | null | CommonTools/Loggers/SlackNotifications.py | AdamSwenson/TwitterProject | 8c5dc7a57eac611b555058736d609f2f204cb836 | [
"MIT"
] | 6 | 2020-03-24T17:34:24.000Z | 2021-12-13T20:14:34.000Z | CommonTools/Loggers/SlackNotifications.py | AdamSwenson/TwitterProject | 8c5dc7a57eac611b555058736d609f2f204cb836 | [
"MIT"
] | null | null | null | """
Created by adam on 5/19/18
"""
__author__ = 'adam'
import json
import xml.etree.ElementTree as ET
import requests
import environment
def load_credentials_file( filepath=environment.SLACK_CREDENTIAL_FILE ):
"""
Opens the credentials file and loads the attributes
"""
return ET.parse( filepath )
... | 22.136364 | 72 | 0.672485 | __author__ = 'adam'
import json
import xml.etree.ElementTree as ET
import requests
import environment
def load_credentials_file( filepath=environment.SLACK_CREDENTIAL_FILE ):
return ET.parse( filepath )
def load_webhook_url():
credentials = load_credentials_file()
return credentials.find('webhook_url'... | true | true |
f75acc2eea8f8671e2c1314a1730f801eae23305 | 19,484 | py | Python | Chapter-07/collections/ansible_collections/community/vmware/plugins/modules/vmware_resource_pool.py | PacktPublishing/Ansible-for-Real-life-Automation | 35c0d92ea08a5dbf3bea749e1971cffabd5e6de4 | [
"MIT"
] | 7 | 2021-11-16T04:05:42.000Z | 2022-02-19T21:14:29.000Z | Chapter-07/collections/ansible_collections/community/vmware/plugins/modules/vmware_resource_pool.py | PacktPublishing/Ansible-for-Real-life-Automation | 35c0d92ea08a5dbf3bea749e1971cffabd5e6de4 | [
"MIT"
] | 1 | 2022-03-12T02:25:26.000Z | 2022-03-12T02:25:26.000Z | Chapter-07/collections/ansible_collections/community/vmware/plugins/modules/vmware_resource_pool.py | PacktPublishing/Ansible-for-Real-life-Automation | 35c0d92ea08a5dbf3bea749e1971cffabd5e6de4 | [
"MIT"
] | 1 | 2022-03-01T05:43:07.000Z | 2022-03-01T05:43:07.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Davis Phillips davis.phillips@gmail.com
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module:... | 39.046092 | 159 | 0.624615 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: vmware_resource_pool
short_description: Add/remove resource pools to/from vCenter
description:
- This module can be used to add/remove a resource pool to/from vCenter
author:
- Davis Phillips (... | true | true |
f75accadcfb70c970ddcec17814397270270c0d3 | 7,951 | py | Python | workflows/dataflow/fv3net/pipelines/common.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | 1 | 2021-12-14T23:43:35.000Z | 2021-12-14T23:43:35.000Z | workflows/dataflow/fv3net/pipelines/common.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | 195 | 2021-09-16T05:47:18.000Z | 2022-03-31T22:03:15.000Z | workflows/dataflow/fv3net/pipelines/common.py | ai2cm/fv3net | e62038aee0a97d6207e66baabd8938467838cf51 | [
"MIT"
] | null | null | null | import os
import shutil
import tempfile
import logging
from datetime import timedelta
from typing import Any, Callable, List, Tuple, TypeVar
from typing.io import BinaryIO
import apache_beam as beam
import xarray as xr
from apache_beam.io import filesystems
from vcm.cloud.fsspec import get_fs
from vcm import parse_ti... | 32.060484 | 127 | 0.650358 | import os
import shutil
import tempfile
import logging
from datetime import timedelta
from typing import Any, Callable, List, Tuple, TypeVar
from typing.io import BinaryIO
import apache_beam as beam
import xarray as xr
from apache_beam.io import filesystems
from vcm.cloud.fsspec import get_fs
from vcm import parse_ti... | true | true |
f75acd18172a48b93ef1978013b41f76511c2a4d | 629 | py | Python | manage.py | ylgnerbecton/ruby-dev-test-1 | 2f1deb21aa008b0ffeec31505460080cf89ecf2c | [
"MIT"
] | null | null | null | manage.py | ylgnerbecton/ruby-dev-test-1 | 2f1deb21aa008b0ffeec31505460080cf89ecf2c | [
"MIT"
] | null | null | null | manage.py | ylgnerbecton/ruby-dev-test-1 | 2f1deb21aa008b0ffeec31505460080cf89ecf2c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'clicksign.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | 28.590909 | 73 | 0.683625 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'clicksign.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f75acd588e0d87808f70da488e22cb6c151a8234 | 14,049 | py | Python | code/instance_evolver.py | ahillbs/minimum_scan_cover | e41718e5a8e0e3039d161800da70e56bd50a1b97 | [
"MIT"
] | null | null | null | code/instance_evolver.py | ahillbs/minimum_scan_cover | e41718e5a8e0e3039d161800da70e56bd50a1b97 | [
"MIT"
] | null | null | null | code/instance_evolver.py | ahillbs/minimum_scan_cover | e41718e5a8e0e3039d161800da70e56bd50a1b97 | [
"MIT"
] | null | null | null | import os
import subprocess
from inspect import isclass
import configargparse
import numpy as np
import sqlalchemy
import yaml
from IPython import embed
from angular_solver import solve
from database import Config, ConfigHolder, Graph, Task, get_session, DatabaseGraphGenome
from genetic_algorithm import (GeneticAlgo... | 52.226766 | 199 | 0.677984 | import os
import subprocess
from inspect import isclass
import configargparse
import numpy as np
import sqlalchemy
import yaml
from IPython import embed
from angular_solver import solve
from database import Config, ConfigHolder, Graph, Task, get_session, DatabaseGraphGenome
from genetic_algorithm import (GeneticAlgo... | true | true |
f75ace5e5cdac314e605985b843ed85f51bcb5fb | 78 | py | Python | bootstrap/mara/__main__.py | dacjames/mara-lang | 4f09e600f8b6907b9f610c7be0814365adad4fdf | [
"MIT"
] | 1 | 2016-09-21T23:19:41.000Z | 2016-09-21T23:19:41.000Z | bootstrap/mara/__main__.py | dacjames/mara-lang | 4f09e600f8b6907b9f610c7be0814365adad4fdf | [
"MIT"
] | null | null | null | bootstrap/mara/__main__.py | dacjames/mara-lang | 4f09e600f8b6907b9f610c7be0814365adad4fdf | [
"MIT"
] | null | null | null | import interpreter
shell = interpreter.Interpreter(shell=True)
shell.loop()
| 13 | 43 | 0.794872 | import interpreter
shell = interpreter.Interpreter(shell=True)
shell.loop()
| true | true |
f75ad024086bcad07c661653f2cea2b77e2de5ec | 4,771 | py | Python | tests/exchange/test_liquidity_pool.py | adietrichs/uniswap-solidity | 98f8021ec501572af42046dcde0de6804df8a6c6 | [
"MIT"
] | 63 | 2019-03-02T13:00:41.000Z | 2022-03-09T20:32:13.000Z | tests/exchange/test_liquidity_pool.py | adietrichs/uniswap-solidity | 98f8021ec501572af42046dcde0de6804df8a6c6 | [
"MIT"
] | 3 | 2019-03-02T13:06:03.000Z | 2020-10-22T12:20:26.000Z | tests/exchange/test_liquidity_pool.py | adietrichs/uniswap-solidity | 98f8021ec501572af42046dcde0de6804df8a6c6 | [
"MIT"
] | 28 | 2019-04-18T06:31:28.000Z | 2022-03-06T18:54:14.000Z | from tests.constants import (
ETH_RESERVE,
HAY_RESERVE,
DEN_RESERVE,
INITIAL_ETH,
DEADLINE,
)
def test_initial_balances(w3, HAY_token, HAY_exchange, DEN_token, DEN_exchange):
a0, a1, a2 = w3.eth.accounts[:3]
# BUYER
assert HAY_token.balanceOf(a1) == 0
assert DEN_token.balanceOf(a1) ... | 54.83908 | 121 | 0.712848 | from tests.constants import (
ETH_RESERVE,
HAY_RESERVE,
DEN_RESERVE,
INITIAL_ETH,
DEADLINE,
)
def test_initial_balances(w3, HAY_token, HAY_exchange, DEN_token, DEN_exchange):
a0, a1, a2 = w3.eth.accounts[:3]
assert HAY_token.balanceOf(a1) == 0
assert DEN_token.balanceOf(a1) == 0
... | true | true |
f75ad0cb74f743fbfe7a6e8ebe927ce7b52d8c22 | 1,894 | py | Python | ivy/jax/core/device.py | 792370706/Ivy | d5d3d92443dfb590335554dd4ce834ea675189fe | [
"Apache-2.0"
] | null | null | null | ivy/jax/core/device.py | 792370706/Ivy | d5d3d92443dfb590335554dd4ce834ea675189fe | [
"Apache-2.0"
] | null | null | null | ivy/jax/core/device.py | 792370706/Ivy | d5d3d92443dfb590335554dd4ce834ea675189fe | [
"Apache-2.0"
] | null | null | null | """
Collection of Jax device functions, wrapped to fit Ivy syntax and signature.
"""
# global
import os
import jax as _jax
# local
from ivy.core.device import Profiler as BaseProfiler
# Helpers #
# --------#
def _to_array(x):
if isinstance(x, _jax.interpreters.ad.JVPTracer):
return _to_array(x.primal)
... | 19.525773 | 76 | 0.652059 |
import os
import jax as _jax
from ivy.core.device import Profiler as BaseProfiler
def _to_array(x):
if isinstance(x, _jax.interpreters.ad.JVPTracer):
return _to_array(x.primal)
elif isinstance(x, _jax.interpreters.partial_eval.DynamicJaxprTracer):
return _to_array(x.aval)
return x
de... | true | true |
f75ad174cbd18837cbaa7a7e051768b976556e70 | 1,295 | py | Python | easyui/runserver.py | the1bit/easyazureui | f979f6a1394e5e7bb6e47525b11dff80e7dd4f9c | [
"MIT"
] | null | null | null | easyui/runserver.py | the1bit/easyazureui | f979f6a1394e5e7bb6e47525b11dff80e7dd4f9c | [
"MIT"
] | null | null | null | easyui/runserver.py | the1bit/easyazureui | f979f6a1394e5e7bb6e47525b11dff80e7dd4f9c | [
"MIT"
] | null | null | null | """
This script runs the EasyAzureUI1 application using a development server.
"""
import time
time.sleep(5)
from os import environ
import json
import sys
import os.path
try:
configFile = 'EasyAzureUI1/config/config.json'
with open(configFile, 'r') as json_file:
config = json.load(json_file)
... | 24.903846 | 73 | 0.628571 | import time
time.sleep(5)
from os import environ
import json
import sys
import os.path
try:
configFile = 'EasyAzureUI1/config/config.json'
with open(configFile, 'r') as json_file:
config = json.load(json_file)
environ['AZURE_TENANT'] = config["tenant"]
environ['AZURE_DEFAULTSUBSCRIP... | true | true |
f75ad267183d55fbdefb0fee62c3916ba40d628b | 111 | py | Python | djangoServer/MapHandler/map/admin.py | sakibchowdhury131/ESP8266_NEO6MGPS_LEAFLETJS | 4aa5ce552a7e5ad694d91088c74112031b05db43 | [
"MIT"
] | null | null | null | djangoServer/MapHandler/map/admin.py | sakibchowdhury131/ESP8266_NEO6MGPS_LEAFLETJS | 4aa5ce552a7e5ad694d91088c74112031b05db43 | [
"MIT"
] | null | null | null | djangoServer/MapHandler/map/admin.py | sakibchowdhury131/ESP8266_NEO6MGPS_LEAFLETJS | 4aa5ce552a7e5ad694d91088c74112031b05db43 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import loc
# Register your models here.
admin.site.register(loc) | 22.2 | 32 | 0.801802 | from django.contrib import admin
from .models import loc
admin.site.register(loc) | true | true |
f75ad275764b199a025033a1f3299bd5c0ef4c62 | 5,438 | py | Python | sdk/python/pulumi_azure_nextgen/logic/v20190501/integration_service_environment_managed_api.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/logic/v20190501/integration_service_environment_managed_api.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/logic/v20190501/integration_service_environment_managed_api.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 39.693431 | 143 | 0.648032 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = ['IntegrationServiceEnvironmentManagedApi']
class IntegrationServiceEnvironmentManagedApi(pulumi.CustomResource):
def __init__(__self... | true | true |
f75ad29efcc632ec405e4c4f83062dc4123518ef | 4,667 | py | Python | modeling/src/nlp_ignite_engines.py | aounleonardo/Spread-Classification | 22c643252e31df367dfeb55fd1a5397dabd7f2b4 | [
"MIT"
] | null | null | null | modeling/src/nlp_ignite_engines.py | aounleonardo/Spread-Classification | 22c643252e31df367dfeb55fd1a5397dabd7f2b4 | [
"MIT"
] | null | null | null | modeling/src/nlp_ignite_engines.py | aounleonardo/Spread-Classification | 22c643252e31df367dfeb55fd1a5397dabd7f2b4 | [
"MIT"
] | null | null | null | import torch
from ignite.engine.engine import Engine, State, Events
from ignite.utils import convert_tensor
def _prepare_batch(batch, device=None, non_blocking=False):
"""Prepare batch for training: pass to a device with options.
"""
x, attention_mask, y = batch
return (
convert_tensor(x, de... | 38.891667 | 120 | 0.673666 | import torch
from ignite.engine.engine import Engine, State, Events
from ignite.utils import convert_tensor
def _prepare_batch(batch, device=None, non_blocking=False):
x, attention_mask, y = batch
return (
convert_tensor(x, device=device, non_blocking=non_blocking),
convert_tensor(attention_m... | true | true |
f75ad2f3a7078510d9060095ba75d816c8b1020b | 817 | py | Python | usaspending_api/search/models/tas_autocomplete_matview.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | 217 | 2016-11-03T17:09:53.000Z | 2022-03-10T04:17:54.000Z | usaspending_api/search/models/tas_autocomplete_matview.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | 622 | 2016-09-02T19:18:23.000Z | 2022-03-29T17:11:01.000Z | usaspending_api/search/models/tas_autocomplete_matview.py | g4brielvs/usaspending-api | bae7da2c204937ec1cdf75c052405b13145728d5 | [
"CC0-1.0"
] | 93 | 2016-09-07T20:28:57.000Z | 2022-02-25T00:25:27.000Z | from django.db import models
class TASAutocompleteMatview(models.Model):
"""
Supports TAS autocomplete. For performance reasons, pre-filters the TAS
codes/numbers/symbols/whatever that can be linked to File D data.
"""
tas_autocomplete_id = models.IntegerField(primary_key=True)
allocation_tr... | 34.041667 | 76 | 0.750306 | from django.db import models
class TASAutocompleteMatview(models.Model):
tas_autocomplete_id = models.IntegerField(primary_key=True)
allocation_transfer_agency_id = models.TextField(null=True)
agency_id = models.TextField()
beginning_period_of_availability = models.TextField(null=True)
ending_per... | true | true |
f75ad36c0f0fafa29d43d2fc1ba948ceb7806ab7 | 1,557 | py | Python | pkg/pkg/io/io.py | dlee0156/bilateral-connectome | 26fe165341bb79379fecdd8bc5d7b5bfe3983fdc | [
"MIT"
] | null | null | null | pkg/pkg/io/io.py | dlee0156/bilateral-connectome | 26fe165341bb79379fecdd8bc5d7b5bfe3983fdc | [
"MIT"
] | null | null | null | pkg/pkg/io/io.py | dlee0156/bilateral-connectome | 26fe165341bb79379fecdd8bc5d7b5bfe3983fdc | [
"MIT"
] | null | null | null | import os
from pathlib import Path
import matplotlib.pyplot as plt
def _handle_dirs(pathname, foldername, subfoldername):
path = Path(pathname)
if foldername is not None:
path = path / foldername
if not os.path.isdir(path):
os.mkdir(path)
if subfoldername is not None:
... | 24.714286 | 72 | 0.623635 | import os
from pathlib import Path
import matplotlib.pyplot as plt
def _handle_dirs(pathname, foldername, subfoldername):
path = Path(pathname)
if foldername is not None:
path = path / foldername
if not os.path.isdir(path):
os.mkdir(path)
if subfoldername is not None:
... | true | true |
f75ad3dd090d4fed59df4676e7b396e53d76e018 | 2,804 | py | Python | linux.py | Recongt/rpi_ws281x | 077c3fb9b783263ee4349477329304f9ddc70dfa | [
"BSD-2-Clause"
] | null | null | null | linux.py | Recongt/rpi_ws281x | 077c3fb9b783263ee4349477329304f9ddc70dfa | [
"BSD-2-Clause"
] | null | null | null | linux.py | Recongt/rpi_ws281x | 077c3fb9b783263ee4349477329304f9ddc70dfa | [
"BSD-2-Clause"
] | null | null | null | #
# linux.py
#
# Copyright (c) 2014 Jeremy Garff <jer @ jers.net>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notic... | 34.617284 | 99 | 0.638374 |
import SCons
tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas']
def linux_tools(env):
for tool in tools:
env.Tool(tool)
if not env['V']:
env['ARCOMSTR'] = 'AR ${TARGET}'
env['ASCOMSTR'] = 'AS ${TARGET}'
env['CCCOMSTR'] = 'CC ${TARGET}'
env[... | true | true |
f75ad5124780f539a1885e24193acbaf48c2b324 | 290 | py | Python | indeedjobs/items.py | smileymike/indeedjobs | 5403ac79cf9ca15dfd97c2343393e8ba4cb1350e | [
"MIT"
] | null | null | null | indeedjobs/items.py | smileymike/indeedjobs | 5403ac79cf9ca15dfd97c2343393e8ba4cb1350e | [
"MIT"
] | null | null | null | indeedjobs/items.py | smileymike/indeedjobs | 5403ac79cf9ca15dfd97c2343393e8ba4cb1350e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class IndeedjobsItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass
| 19.333333 | 52 | 0.689655 |
import scrapy
class IndeedjobsItem(scrapy.Item):
pass
| true | true |
f75ad5d206cac493db3ab30e994297125de73fa6 | 2,614 | py | Python | doc/source/conf.py | andriygav/MLResearchToolkit | 3be47bfb1f44950f2c377f24d39c3ebbb24bfff5 | [
"MIT"
] | 1 | 2020-09-08T22:24:42.000Z | 2020-09-08T22:24:42.000Z | doc/source/conf.py | andriygav/MLResearchToolkit | 3be47bfb1f44950f2c377f24d39c3ebbb24bfff5 | [
"MIT"
] | null | null | null | doc/source/conf.py | andriygav/MLResearchToolkit | 3be47bfb1f44950f2c377f24d39c3ebbb24bfff5 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 34.394737 | 79 | 0.654552 |
import os
import sys
sys.path.insert(0, os.path.abspath('../../src/'))
from ml_research_toolkit import __version__
project = 'MLResearchToolkit'
copyright = '2020, Andrey Grabovoy'
author = 'Andrey Grabovoy'
version = __version__
master_doc = 'index'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
... | true | true |
f75ad84f5d0546fb07df11250422c860d215de5e | 32,003 | py | Python | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resources_operations.py | jeffrey-ACE/azure-sdk-for-python | 648ec57b3dede3ba8b90ddde0923f254bb363583 | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resources_operations.py | jeffrey-ACE/azure-sdk-for-python | 648ec57b3dede3ba8b90ddde0923f254bb363583 | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-resource/azure/mgmt/resource/resources/v2016_02_01/operations/resources_operations.py | jeffrey-ACE/azure-sdk-for-python | 648ec57b3dede3ba8b90ddde0923f254bb363583 | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 48.785061 | 198 | 0.673249 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.exceptions import DeserializationError
from msrestazure.azure_operation import AzureOperationPoller
from .. import models
class ResourcesOperations(object):
models = models
def __init_... | true | true |
f75ae20155e6b87aa1e4c48f5b77103dfb988892 | 12,304 | py | Python | messages/compiler/cpp/cpp_visitor.py | evdzhurov/concord-bft | 2e4fdabe0228b51d4d43398158e97d4e36ff974a | [
"Apache-2.0"
] | null | null | null | messages/compiler/cpp/cpp_visitor.py | evdzhurov/concord-bft | 2e4fdabe0228b51d4d43398158e97d4e36ff974a | [
"Apache-2.0"
] | null | null | null | messages/compiler/cpp/cpp_visitor.py | evdzhurov/concord-bft | 2e4fdabe0228b51d4d43398158e97d4e36ff974a | [
"Apache-2.0"
] | null | null | null | # Concord
#
# Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache 2.0 license (the "License").
# You may not use this product except in compliance with the Apache 2.0 License.
#
# This product may include a number of subcomponents with separate copyright
# noti... | 31.070707 | 103 | 0.649951 | # file.
from visitor import Visitor
def struct_start(name, id):
return f"""
struct {name} {{
static constexpr uint32_t id = {id};
"""
serialize_byte_buffer_fn = "void serialize(std::vector<uint8_t>& output, const {name}& t)"
def serialize_byte_buffer_declaration(name):
return serialize_byte_buffer_fn.... | true | true |
f75ae2319c2822ce2554934f69c6e01738d8f0ce | 1,928 | py | Python | test/torchaudio_unittest/datasets/utils_test.py | adefossez/audio | 19fc580da97baf179395bb257647c5c25b993e42 | [
"BSD-2-Clause"
] | 1 | 2021-04-20T09:04:24.000Z | 2021-04-20T09:04:24.000Z | test/torchaudio_unittest/datasets/utils_test.py | adefossez/audio | 19fc580da97baf179395bb257647c5c25b993e42 | [
"BSD-2-Clause"
] | null | null | null | test/torchaudio_unittest/datasets/utils_test.py | adefossez/audio | 19fc580da97baf179395bb257647c5c25b993e42 | [
"BSD-2-Clause"
] | 1 | 2019-09-11T08:27:18.000Z | 2019-09-11T08:27:18.000Z | import os
from pathlib import Path
from torchaudio.datasets import utils as dataset_utils
from torchaudio.datasets.commonvoice import COMMONVOICE
from torchaudio_unittest.common_utils import (
TempDirMixin,
TorchaudioTestCase,
get_asset_path,
)
class TestWalkFiles(TempDirMixin, TorchaudioTestCase):
... | 27.942029 | 91 | 0.592842 | import os
from pathlib import Path
from torchaudio.datasets import utils as dataset_utils
from torchaudio.datasets.commonvoice import COMMONVOICE
from torchaudio_unittest.common_utils import (
TempDirMixin,
TorchaudioTestCase,
get_asset_path,
)
class TestWalkFiles(TempDirMixin, TorchaudioTestCase):
... | true | true |
f75ae29b82378cf0bb568f8bc18499aa48faca30 | 5,390 | py | Python | trulia_scraper/spiders/sale_300.py | GPSBach/luther | b95acb920b42fee5f85db139d2d17146ee45a6a8 | [
"MIT"
] | null | null | null | trulia_scraper/spiders/sale_300.py | GPSBach/luther | b95acb920b42fee5f85db139d2d17146ee45a6a8 | [
"MIT"
] | null | null | null | trulia_scraper/spiders/sale_300.py | GPSBach/luther | b95acb920b42fee5f85db139d2d17146ee45a6a8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import scrapy
import math
import datetime
from scrapy.linkextractors import LinkExtractor
from trulia_scraper.items import TruliaItem, TruliaItemLoader
from trulia_scraper.parsing import get_number_from_string
from scrapy.utils.conf import closest_scrapy_cfg
class TruliaSpider(scrapy... | 55 | 131 | 0.638776 | import os
import scrapy
import math
import datetime
from scrapy.linkextractors import LinkExtractor
from trulia_scraper.items import TruliaItem, TruliaItemLoader
from trulia_scraper.parsing import get_number_from_string
from scrapy.utils.conf import closest_scrapy_cfg
class TruliaSpider(scrapy.Spider):
name = 'sa... | true | true |
f75ae31f1653d9854cd3925138e968fc94a94e29 | 3,308 | py | Python | tests/images/test_abstract_canvas.py | janfreyberg/ipyannotate | b1c30fe73bfda107d4ef75945338d42bfe8e3b64 | [
"MIT"
] | 19 | 2020-01-15T08:18:06.000Z | 2022-03-11T01:26:00.000Z | tests/images/test_abstract_canvas.py | janfreyberg/ipyannotate | b1c30fe73bfda107d4ef75945338d42bfe8e3b64 | [
"MIT"
] | 8 | 2020-01-23T14:02:38.000Z | 2021-09-06T10:49:48.000Z | tests/images/test_abstract_canvas.py | janfreyberg/ipyannotate | b1c30fe73bfda107d4ef75945338d42bfe8e3b64 | [
"MIT"
] | 4 | 2020-02-19T18:41:06.000Z | 2021-11-01T12:15:01.000Z | import pathlib
import tempfile
from typing import Tuple, Union
from unittest.mock import patch
import ipywidgets as widgets
import numpy as np
from hypothesis import assume, given, infer, settings, strategies
from PIL import Image
from ipyannotations.images.canvases.abstract_canvas import (
AbstractAnnotationCanv... | 28.033898 | 79 | 0.702842 | import pathlib
import tempfile
from typing import Tuple, Union
from unittest.mock import patch
import ipywidgets as widgets
import numpy as np
from hypothesis import assume, given, infer, settings, strategies
from PIL import Image
from ipyannotations.images.canvases.abstract_canvas import (
AbstractAnnotationCanv... | true | true |
f75ae36e0ff1f8b3b437c9449f01e299dcf5f13d | 746 | py | Python | charity/migrations/0014_auto_20210902_1630.py | drkane/find-that-charity | 25f778cfa1429e465bc19a6465b09f0473cfe113 | [
"MIT"
] | 14 | 2018-09-14T11:51:26.000Z | 2021-02-28T22:00:29.000Z | charity/migrations/0014_auto_20210902_1630.py | drkane/find-that-charity | 25f778cfa1429e465bc19a6465b09f0473cfe113 | [
"MIT"
] | 89 | 2018-01-26T22:20:43.000Z | 2022-01-20T14:16:25.000Z | charity/migrations/0014_auto_20210902_1630.py | drkane/find-that-charity | 25f778cfa1429e465bc19a6465b09f0473cfe113 | [
"MIT"
] | 7 | 2019-01-31T11:23:17.000Z | 2022-03-09T07:42:08.000Z | # Generated by Django 3.2.5 on 2021-09-02 15:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("charity", "0013_auto_20210818_1053"),
]
operations = [
migrations.AddField(
model_name="charity",
name="employees",
... | 25.724138 | 76 | 0.575067 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("charity", "0013_auto_20210818_1053"),
]
operations = [
migrations.AddField(
model_name="charity",
name="employees",
field=models.IntegerField(blank=True... | true | true |
f75ae3f598601383a8e40116fe4c0e34b7b54f63 | 36,368 | py | Python | evcouplings/compare/protocol.py | thomashopf/EVcouplings-1 | d3e4947d29b62537bd79215ce72b6eea18134850 | [
"MIT"
] | null | null | null | evcouplings/compare/protocol.py | thomashopf/EVcouplings-1 | d3e4947d29b62537bd79215ce72b6eea18134850 | [
"MIT"
] | null | null | null | evcouplings/compare/protocol.py | thomashopf/EVcouplings-1 | d3e4947d29b62537bd79215ce72b6eea18134850 | [
"MIT"
] | 2 | 2021-04-03T14:19:12.000Z | 2021-04-05T17:34:32.000Z | """
EC to 3D structure comparison protocols/workflows.
Authors:
Thomas A. Hopf
Anna G. Green (complex and _make_complex_contact_maps)
"""
from copy import deepcopy
from math import ceil
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from evcouplings.align.alignment import (
read_fasta... | 34.801914 | 113 | 0.613836 |
from copy import deepcopy
from math import ceil
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from evcouplings.align.alignment import (
read_fasta, parse_header
)
from evcouplings.utils.config import (
check_required, InvalidParameterError
)
from evcouplings.utils.system import (
... | true | true |
f75ae4776f62cce5fcc9e993bcf8ce3bf682f064 | 214 | py | Python | mods/mcpython/Item/iron_ore.py | uuk0/mcpython-a-minecraft-clone-in-python | c16cd66f319efdeec4130e1a43f5a857caf1ea13 | [
"MIT"
] | 2 | 2020-04-23T16:25:51.000Z | 2020-08-27T17:56:16.000Z | mods/mcpython/Item/iron_ore.py | uuk0/mcpython-a-minecraft-clone-in-python | c16cd66f319efdeec4130e1a43f5a857caf1ea13 | [
"MIT"
] | null | null | null | mods/mcpython/Item/iron_ore.py | uuk0/mcpython-a-minecraft-clone-in-python | c16cd66f319efdeec4130e1a43f5a857caf1ea13 | [
"MIT"
] | null | null | null | from .Item import *
class IronOre(Item):
def getName(self):
return "minecraft:iron_ore"
def getTexturFile(self):
return "./assets/textures/items/iron_ore.png"
handler.register(IronOre)
| 16.461538 | 53 | 0.67757 | from .Item import *
class IronOre(Item):
def getName(self):
return "minecraft:iron_ore"
def getTexturFile(self):
return "./assets/textures/items/iron_ore.png"
handler.register(IronOre)
| true | true |
f75ae4eb9608a10bf8d08c63342536f472c7fb94 | 1,280 | py | Python | bookworm/library/testmodels.py | srilatha44/threepress | 263b8aee8353806bd860bc22daf019e2155b8d0f | [
"BSD-3-Clause"
] | 2 | 2020-05-03T16:54:33.000Z | 2021-11-24T21:05:05.000Z | bookworm/library/testmodels.py | srilatha44/threepress | 263b8aee8353806bd860bc22daf019e2155b8d0f | [
"BSD-3-Clause"
] | 1 | 2022-02-12T09:20:29.000Z | 2022-02-12T09:20:29.000Z | bookworm/library/testmodels.py | srilatha44/threepress | 263b8aee8353806bd860bc22daf019e2155b8d0f | [
"BSD-3-Clause"
] | 1 | 2022-02-12T09:02:02.000Z | 2022-02-12T09:02:02.000Z | from models import *
class MockEpubArchive(EpubArchive):
'''Mock object to expose some protected methods for testing purposes, and use
overridden mock related classes with different storage directories.'''
def get_author(self, opf):
self.authors = self._get_authors(opf)
return self.autho... | 26.666667 | 81 | 0.673438 | from models import *
class MockEpubArchive(EpubArchive):
def get_author(self, opf):
self.authors = self._get_authors(opf)
return self.author
def get_authors(self, opf):
return self._get_authors(opf)
def get_metadata(self, tag, opf):
return self._get_metadata(tag, opf)
... | true | true |
f75ae51c4d9443717e05bb475e9e4ca9541cfae3 | 22,145 | py | Python | sdk/python/pulumi_azure_native/network/v20161201/local_network_gateway.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20161201/local_network_gateway.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20161201/local_network_gateway.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 56.636829 | 5,621 | 0.696907 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._inputs import *
__all__ = ['LocalNetworkGatewayInitArgs', 'LocalNetworkGateway']
@pulumi.input_type
class LocalNetworkGatewayInitArgs:
d... | true | true |
f75ae574ac632c5ab48a06f1c82797ea4181f812 | 801 | py | Python | src/workshop/core/scoring/batch_score.py | srkasuMsft/MLOpsTemplate | 0c90ed954c553a3936ecb882cbf35dfd03e14e9d | [
"MIT"
] | 8 | 2022-03-29T04:55:11.000Z | 2022-03-31T15:46:25.000Z | src/workshop/core/scoring/batch_score.py | srkasuMsft/MLOpsTemplate | 0c90ed954c553a3936ecb882cbf35dfd03e14e9d | [
"MIT"
] | 3 | 2022-03-30T15:29:19.000Z | 2022-03-31T21:44:02.000Z | src/workshop/core/scoring/batch_score.py | srkasuMsft/MLOpsTemplate | 0c90ed954c553a3936ecb882cbf35dfd03e14e9d | [
"MIT"
] | 11 | 2022-03-28T22:26:56.000Z | 2022-03-31T19:23:44.000Z |
import os
import tempfile
import logging
from azureml.core.model import Model
import pickle
import pandas as pd
from azureml.core import Run
import os
import mlflow
def init():
global model
model_dir =os.getenv('AZUREML_MODEL_DIR')
model_file = os.listdir(model_dir)[0]
model_path = os.path.join(os.get... | 22.885714 | 73 | 0.692884 |
import os
import tempfile
import logging
from azureml.core.model import Model
import pickle
import pandas as pd
from azureml.core import Run
import os
import mlflow
def init():
global model
model_dir =os.getenv('AZUREML_MODEL_DIR')
model_file = os.listdir(model_dir)[0]
model_path = os.path.join(os.get... | true | true |
f75ae5d86b92c779819bcb57a0c869a22bc9fed3 | 6,202 | py | Python | run_ppo.py | bayesxl/PB2 | 54b94dc2ebae488ea5e2bf5250a9d10b89011852 | [
"MIT"
] | 22 | 2020-07-18T14:02:18.000Z | 2022-03-17T09:58:52.000Z | run_ppo.py | bayesxl/PB2 | 54b94dc2ebae488ea5e2bf5250a9d10b89011852 | [
"MIT"
] | null | null | null | run_ppo.py | bayesxl/PB2 | 54b94dc2ebae488ea5e2bf5250a9d10b89011852 | [
"MIT"
] | 6 | 2020-07-18T16:06:03.000Z | 2021-12-12T05:16:15.000Z |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import argparse
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime
import ray
from ray.tune import run, sample_from
from ray.tune.schedulers import Popu... | 41.072848 | 160 | 0.619639 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import argparse
import matplotlib.pyplot as plt
import pandas as pd
from datetime import datetime
import ray
from ray.tune import run, sample_from
from ray.tune.schedulers import Popu... | true | true |
f75ae5dd4cd9fea3924db7d3c376a6f8ba092e52 | 540 | py | Python | env/lib/python3.8/site-packages/plotly/validators/densitymapbox/colorbar/title/font/_size.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/densitymapbox/colorbar/title/font/_size.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/densitymapbox/colorbar/title/font/_size.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="size",
parent_name="densitymapbox.colorbar.title.font",
**kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotl... | 28.421053 | 66 | 0.6 | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self,
plotly_name="size",
parent_name="densitymapbox.colorbar.title.font",
**kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotl... | true | true |
f75ae775b1e817cbce1d086bbda08c0bf48bb3df | 16,666 | py | Python | resources/usr/local/lib/python2.7/dist-packages/Bio/codonalign/codonalignment.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/local/lib/python2.7/dist-packages/Bio/codonalign/codonalignment.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/local/lib/python2.7/dist-packages/Bio/codonalign/codonalignment.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | 1 | 2020-05-28T23:01:44.000Z | 2020-05-28T23:01:44.000Z | # Copyright 2013 by Zheng Ruan (zruan1991@gmail.com).
# All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Code for dealing with Codon Alignment.
CodonAlignment class is inherite... | 37.451685 | 89 | 0.598584 | from __future__ import division, print_function
from Bio.Align import MultipleSeqAlignment
from Bio.SeqRecord import SeqRecord
from Bio.codonalign.codonalphabet import default_codon_table, default_codon_alphabet
from Bio.codonalign.codonseq import _get_codon_list, CodonSeq, cal_dn_ds
from Bio.codonalign.chisq import ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.