hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f728078abdd363c3b5a9fa5e8cb21ce1ecaa6d60 | 18,868 | py | Python | hashsum.py | avalentino/hashsum | 1bc36e78439ee066626d7875fc4e8ae20f0aa2f8 | [
"BSD-3-Clause"
] | 1 | 2016-01-12T13:23:16.000Z | 2016-01-12T13:23:16.000Z | hashsum.py | avalentino/hashsum | 1bc36e78439ee066626d7875fc4e8ae20f0aa2f8 | [
"BSD-3-Clause"
] | 1 | 2021-07-17T19:37:10.000Z | 2021-07-17T19:37:10.000Z | hashsum.py | avalentino/hashsum | 1bc36e78439ee066626d7875fc4e8ae20f0aa2f8 | [
"BSD-3-Clause"
] | 2 | 2021-07-17T18:50:53.000Z | 2021-07-30T03:48:27.000Z | #!/usr/bin/env python3
"""Compute and check message digest with different hash algorithms.
The sums are computed as described in [1].
When checking, the input should be a former output of this program.
The default mode is to print a line with checksum, a character indicating
input mode ('*' for binary, space for text... | 31.499165 | 79 | 0.586337 |
import io
import os
import re
import sys
import enum
import codecs
import hashlib
import logging
import argparse
import warnings
import functools
try:
from os import EX_OK
except ImportError:
EX_OK = 0
EX_FAILURE = 1
EX_INTERRUPT = 130
try:
import argcomplete
except ImportError:
argcomplete = Fals... | true | true |
f7280829cd5870fc25cdeff05cf7df3d0f29788d | 18,748 | py | Python | python/GafferUI/NodeGraph.py | Kthulhu/gaffer | 8995d579d07231988abc92c3ac2788c15c8bc75c | [
"BSD-3-Clause"
] | 1 | 2016-07-31T09:55:09.000Z | 2016-07-31T09:55:09.000Z | python/GafferUI/NodeGraph.py | Kthulhu/gaffer | 8995d579d07231988abc92c3ac2788c15c8bc75c | [
"BSD-3-Clause"
] | null | null | null | python/GafferUI/NodeGraph.py | Kthulhu/gaffer | 8995d579d07231988abc92c3ac2788c15c8bc75c | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | 37.722334 | 154 | 0.727864 | adget ) :
nodeGadget = nodeGadget.ancestor( GafferUI.NodeGadget )
if nodeGadget is not None :
self.nodeContextMenuSignal()( self, nodeGadget.node(), overrideMenuDefinition )
overrideMenuTitle = nodeGadget.node().getName()
if len( overrideMenuDefinition.items() ) :
menuDefinition = overr... | true | true |
f728087f4eef364c01b64b3e6706780a87d04def | 69 | py | Python | enrichmentmanager/__init__.py | rectory-school/rectory-apps | 184021529ac9cadc3b7c0fbf93a023c82fc76b91 | [
"MIT"
] | null | null | null | enrichmentmanager/__init__.py | rectory-school/rectory-apps | 184021529ac9cadc3b7c0fbf93a023c82fc76b91 | [
"MIT"
] | 5 | 2020-06-05T17:33:12.000Z | 2021-06-10T19:04:41.000Z | enrichmentmanager/__init__.py | rectory-school/rectory-apps | 184021529ac9cadc3b7c0fbf93a023c82fc76b91 | [
"MIT"
] | 1 | 2016-02-08T15:53:28.000Z | 2016-02-08T15:53:28.000Z | default_app_config = 'enrichmentmanager.apps.EnrichmentManagerConfig' | 69 | 69 | 0.898551 | default_app_config = 'enrichmentmanager.apps.EnrichmentManagerConfig' | true | true |
f7280952fd1b6ce7de2b86889e2486b217763d23 | 10,395 | py | Python | setup.py | duanwujie/grpc-hacking | 4275e60eb686ceb202c042fe578c9cf992e590d0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | duanwujie/grpc-hacking | 4275e60eb686ceb202c042fe578c9cf992e590d0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | duanwujie/grpc-hacking | 4275e60eb686ceb202c042fe578c9cf992e590d0 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 39.675573 | 120 | 0.738432 |
from distutils import cygwinccompiler
from distutils import extension as _extension
from distutils import util
import os
import os.path
import pkg_resources
import platform
import re
import shlex
import shutil
import sys
import sysconfig
import setuptools
from setuptools.command import egg... | true | true |
f72809962a0c3afdf36566332c18dc62cdc19907 | 945 | py | Python | fake_rdp.py | cheeseandcereal/fake-rdp | c35bd69d2796417b68d938079806bf27f4393343 | [
"Unlicense"
] | 9 | 2020-09-07T16:50:13.000Z | 2021-09-25T21:19:54.000Z | fake_rdp.py | khast3x/fake-rdp | c35bd69d2796417b68d938079806bf27f4393343 | [
"Unlicense"
] | null | null | null | fake_rdp.py | khast3x/fake-rdp | c35bd69d2796417b68d938079806bf27f4393343 | [
"Unlicense"
] | 4 | 2020-10-31T08:52:08.000Z | 2021-10-05T17:17:36.000Z | #!/usr/bin/env python
"""Fake RDP Server"""
import socket
import time
def fake_server():
"""Start a socket on port 3389 and send init packets"""
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind(('0.0.0.0', 3389))
serversocket.listen(5)
while True:
try:
... | 30.483871 | 79 | 0.614815 |
import socket
import time
def fake_server():
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
serversocket.bind(('0.0.0.0', 3389))
serversocket.listen(5)
while True:
try:
connection, address = serversocket.accept()
print('Recieved connection from {}'.fo... | true | true |
f72809ec1a44d7488f09bb43c6c041ab9700adf5 | 6,188 | py | Python | CandlestickIndicators.py | MarcosVs98/candlestick-indicators | 5423b56751eead43569b15917d29519b4dd6f0e3 | [
"MIT"
] | null | null | null | CandlestickIndicators.py | MarcosVs98/candlestick-indicators | 5423b56751eead43569b15917d29519b4dd6f0e3 | [
"MIT"
] | null | null | null | CandlestickIndicators.py | MarcosVs98/candlestick-indicators | 5423b56751eead43569b15917d29519b4dd6f0e3 | [
"MIT"
] | null | null | null | import logging
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
class ChartIndicatorException(Exception):
pass
class PlottingExeception(ChartIndicatorException):
pass
class TraceCandlesException(ChartIndicatorException):
pass
class ErrorImplementingIndicator... | 35.36 | 98 | 0.713478 | import logging
import numpy as np
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
class ChartIndicatorException(Exception):
pass
class PlottingExeception(ChartIndicatorException):
pass
class TraceCandlesException(ChartIndicatorException):
pass
class ErrorImplementingIndicator... | true | true |
f72809f71761b0df57021f843a5d34d9717f17ed | 5,673 | py | Python | App/controllers/users.py | shyyashowkat/flask_mongo | 72f48efdc9bcf5eb533dd834710e5c728afcf2eb | [
"MIT"
] | null | null | null | App/controllers/users.py | shyyashowkat/flask_mongo | 72f48efdc9bcf5eb533dd834710e5c728afcf2eb | [
"MIT"
] | null | null | null | App/controllers/users.py | shyyashowkat/flask_mongo | 72f48efdc9bcf5eb533dd834710e5c728afcf2eb | [
"MIT"
] | null | null | null | import email
import jwt
import datetime
from models.users import User
from bson.objectid import ObjectId
from utils.email_util import sent_email
from flask import jsonify, make_response
from special_variables import _secret_key
from utils.token_util import token_required
from flask_bcrypt import generate_password_hash,... | 46.884298 | 184 | 0.640931 | import email
import jwt
import datetime
from models.users import User
from bson.objectid import ObjectId
from utils.email_util import sent_email
from flask import jsonify, make_response
from special_variables import _secret_key
from utils.token_util import token_required
from flask_bcrypt import generate_password_hash,... | true | true |
f7280a26b72db20d7bf104af5bdb36d6c33c8284 | 1,883 | py | Python | utils/draw.py | NLP-Discourse-SoochowU/rst_dp2019Bottom2Up | ac1624127c9c8a3301685193ac8239357e01f6ca | [
"MIT"
] | 1 | 2020-08-18T01:28:07.000Z | 2020-08-18T01:28:07.000Z | utils/draw.py | NLP-Discourse-SoochowU/rst_dp2019 | ac1624127c9c8a3301685193ac8239357e01f6ca | [
"MIT"
] | null | null | null | utils/draw.py | NLP-Discourse-SoochowU/rst_dp2019 | ac1624127c9c8a3301685193ac8239357e01f6ca | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Author: lyzhang
@Date: 2018.5.23
@Description:
"""
from config import *
from parser_model.parser import Parser
from utils.file_util import *
from parser_model.form_data import form_data
from nltk.draw.util import CanvasFrame, TextWidget
from nltk.draw import TreeWidget
from nl... | 28.969231 | 98 | 0.6171 |
from config import *
from parser_model.parser import Parser
from utils.file_util import *
from parser_model.form_data import form_data
from nltk.draw.util import CanvasFrame, TextWidget
from nltk.draw import TreeWidget
from nltk import Tree
def draw_gold_test():
form_data_o = form_data()
parser ... | true | true |
f7280a319b602b7ac5975fbaaf74eac97931a87b | 7,877 | py | Python | ros/src/tl_detector/tl_detector.py | nr-patel/NP-SDC-T3-P4-Capstone-Project | d20b4cb009c72f9d1b6fd8f36aca2af4c7bffb08 | [
"MIT"
] | 9 | 2018-03-11T20:07:40.000Z | 2021-04-16T06:29:36.000Z | ros/src/tl_detector/tl_detector.py | nr-patel/NP-SDC-T3-P4-Capstone-Project | d20b4cb009c72f9d1b6fd8f36aca2af4c7bffb08 | [
"MIT"
] | 7 | 2018-03-12T03:43:38.000Z | 2018-03-29T14:18:11.000Z | ros/src/tl_detector/tl_detector.py | nr-patel/NP-SDC-T3-P4-Capstone-Project | d20b4cb009c72f9d1b6fd8f36aca2af4c7bffb08 | [
"MIT"
] | 9 | 2018-03-11T20:36:49.000Z | 2019-08-28T09:59:29.000Z | #!/usr/bin/env python
import rospy
from std_msgs.msg import Int32, Float32MultiArray
from std_msgs.msg import MultiArrayDimension, MultiArrayDimension
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Imag... | 39.582915 | 162 | 0.656849 |
import rospy
from std_msgs.msg import Int32, Float32MultiArray
from std_msgs.msg import MultiArrayDimension, MultiArrayDimension
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge impo... | true | true |
f7280a5a37004164250aef97e15c2187d83ce87b | 16,962 | py | Python | nova/tests/unit/api/openstack/compute/test_create_backup.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,874 | 2015-01-04T05:18:34.000Z | 2022-03-31T03:30:28.000Z | nova/tests/unit/api/openstack/compute/test_create_backup.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 40 | 2015-04-13T02:32:42.000Z | 2022-02-16T02:28:06.000Z | nova/tests/unit/api/openstack/compute/test_create_backup.py | zjzh/nova | 7bb21723171c59b93e28f5d508c2b6df39220f13 | [
"Apache-2.0"
] | 1,996 | 2015-01-04T15:11:51.000Z | 2022-03-31T11:03:13.000Z | # Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 ... | 39.723653 | 79 | 0.557364 |
import mock
from oslo_utils import timeutils
import webob
from nova.api.openstack import common
from nova.api.openstack.compute import create_backup \
as create_backup_v21
from nova.compute import api
from nova.compute import utils as compute_utils
from nova import exception
from nova import tes... | true | true |
f7280a93cddae52a4b9914463d8e388bd3ec425f | 1,990 | py | Python | examples/pandas_chart_columns.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-06-12T15:34:25.000Z | 2019-06-12T15:34:25.000Z | examples/pandas_chart_columns.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | examples/pandas_chart_columns.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ##############################################################################
#
# An example of converting a Pandas dataframe to an xlsx file with a grouped
# column chart using Pandas and XlsxWriter.
#
# Copyright 2013-2019, John McNamara, jmcnamara@cpan.org
#
import pandas as pd
# Some sample data to plot.
farm_1 ... | 34.912281 | 78 | 0.635176 | true | true | |
f7280c2c71718777f3432e2a878f1bc6be839765 | 5,137 | py | Python | tests/test_database.py | theblazehen/starlette | 070d749f66999206c4c71cb203a2ea400e0b3c00 | [
"BSD-3-Clause"
] | 3 | 2021-06-26T17:27:36.000Z | 2021-07-11T15:01:51.000Z | tests/test_database.py | theblazehen/starlette | 070d749f66999206c4c71cb203a2ea400e0b3c00 | [
"BSD-3-Clause"
] | null | null | null | tests/test_database.py | theblazehen/starlette | 070d749f66999206c4c71cb203a2ea400e0b3c00 | [
"BSD-3-Clause"
] | null | null | null | import databases
import pytest
import sqlalchemy
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.testclient import TestClient
DATABASE_URL = "sqlite:///test.db"
metadata = sqlalchemy.MetaData()
notes = sqlalchemy.Table(
"notes",
metadata,
sqlalche... | 30.217647 | 88 | 0.629161 | import databases
import pytest
import sqlalchemy
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.testclient import TestClient
DATABASE_URL = "sqlite:///test.db"
metadata = sqlalchemy.MetaData()
notes = sqlalchemy.Table(
"notes",
metadata,
sqlalche... | true | true |
f7280c970e0c822fb30887a989c0e9ed85002df0 | 498 | py | Python | blog_project/urls.py | huseyinbicen/Python-Django-Example | b718492b3a09ba257e55a5a4bf2674573e1f51c0 | [
"MIT"
] | null | null | null | blog_project/urls.py | huseyinbicen/Python-Django-Example | b718492b3a09ba257e55a5a4bf2674573e1f51c0 | [
"MIT"
] | null | null | null | blog_project/urls.py | huseyinbicen/Python-Django-Example | b718492b3a09ba257e55a5a4bf2674573e1f51c0 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from django.views.generic import TemplateView
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('blog.urls')),
path('about/', TemplateView.as_v... | 38.307692 | 75 | 0.748996 | from django.contrib import admin
from django.urls import path, include
from django.views.generic import TemplateView
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('blog.urls')),
path('about/', TemplateView.as_v... | true | true |
f7280debda64b329f0fe426d6270e57bc1394d50 | 557 | py | Python | recipes/migrations/0003_recipe_thumbnail.py | capcom6/django-bread | db216dce17461debf26b2ec692d3e89eed5c80d7 | [
"Apache-2.0"
] | null | null | null | recipes/migrations/0003_recipe_thumbnail.py | capcom6/django-bread | db216dce17461debf26b2ec692d3e89eed5c80d7 | [
"Apache-2.0"
] | null | null | null | recipes/migrations/0003_recipe_thumbnail.py | capcom6/django-bread | db216dce17461debf26b2ec692d3e89eed5c80d7 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 4.0.2 on 2022-02-23 05:35
import django.core.files.storage
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipes', '0002_remove_recipe_ingredients_and_more'),
]
operations = [
migrations.AddField(
mod... | 27.85 | 171 | 0.667864 |
import django.core.files.storage
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipes', '0002_remove_recipe_ingredients_and_more'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='thumbnail',... | true | true |
f7280e6baf0e8251adc36abab862c40151c328aa | 3,671 | py | Python | pyautospec/function_mps.py | lucamarx/pyAutoSpec | d57efb6ff4c37ede1377351fd3dd3a6ce362b551 | [
"MIT"
] | null | null | null | pyautospec/function_mps.py | lucamarx/pyAutoSpec | d57efb6ff4c37ede1377351fd3dd3a6ce362b551 | [
"MIT"
] | null | null | null | pyautospec/function_mps.py | lucamarx/pyAutoSpec | d57efb6ff4c37ede1377351fd3dd3a6ce362b551 | [
"MIT"
] | null | null | null | """
Mps based function compression algorithm
"""
import numpy as np
import itertools
from typing import List
from .mps import Mps
from .plots import function_wfa_comparison_chart
def word2real(s : List[int], x0 : float = 0.0, x1 : float = 1.0) -> float:
"""
Convert the binary representation s of xϵ[x0,x1) i... | 25.493056 | 162 | 0.542359 | import numpy as np
import itertools
from typing import List
from .mps import Mps
from .plots import function_wfa_comparison_chart
def word2real(s : List[int], x0 : float = 0.0, x1 : float = 1.0) -> float:
s = [0] + s
return x0 + sum([s[i] * 2**(-i) for i in range(len(s))]) * (x1-x0)
def real2word(r : floa... | true | true |
f7280ebe246bd0c4e3a1e4a83d501247c3ec9d7b | 1,560 | py | Python | setup.py | dpshelio/BayesianTracker | 0be7225f958b75540ec6957622c9dd6b96f809bb | [
"MIT"
] | 196 | 2017-11-27T03:05:19.000Z | 2022-03-23T20:04:28.000Z | setup.py | dpshelio/BayesianTracker | 0be7225f958b75540ec6957622c9dd6b96f809bb | [
"MIT"
] | 78 | 2018-07-14T14:30:02.000Z | 2022-03-30T15:11:02.000Z | setup.py | dpshelio/BayesianTracker | 0be7225f958b75540ec6957622c9dd6b96f809bb | [
"MIT"
] | 45 | 2017-11-27T03:05:20.000Z | 2022-03-15T05:57:18.000Z | """BayesianTracker (`btrack`) is a multi object tracking algorithm,
specifically used to reconstruct trajectories in crowded fields. New
observations are assigned to tracks by evaluating the posterior probability of
each potential linkage from a Bayesian belief matrix for all possible
linkages. """
from setuptools im... | 31.836735 | 78 | 0.694231 |
from setuptools import find_packages, setup
def get_install_required():
with open("./requirements.txt", "r") as reqs:
requirements = reqs.readlines()
return [r.rstrip() for r in requirements]
def get_version():
with open("./btrack/VERSION.txt", "r") as ver:
version = ver.readline()
... | true | true |
f7280f19f5c8722b0886a42579dd2cdb8cc9e731 | 204 | py | Python | bin/selectCommands.py | mikiec84/linkshop | 72959ceca0003be226edeca6496f915502831596 | [
"Apache-2.0"
] | 6 | 2017-07-18T15:28:33.000Z | 2020-03-03T14:45:45.000Z | bin/selectCommands.py | mikiec84/linkshop | 72959ceca0003be226edeca6496f915502831596 | [
"Apache-2.0"
] | null | null | null | bin/selectCommands.py | mikiec84/linkshop | 72959ceca0003be226edeca6496f915502831596 | [
"Apache-2.0"
] | 3 | 2017-09-09T00:36:48.000Z | 2020-03-03T14:45:49.000Z | #!/usr/bin/env python3
"""Command-line wrapper for stats.cli_percentageOfLinks."""
import loadPath # Adds the project path.
import linkograph.commandUtils
linkograph.commandUtils.cli_selectCommands()
| 22.666667 | 59 | 0.79902 |
import loadPath
import linkograph.commandUtils
linkograph.commandUtils.cli_selectCommands()
| true | true |
f7280fed5c247e39bbef3d6ffde57f3181053fc2 | 3,371 | py | Python | Simulation_virus_BB.py | Cheese229/DataAssignmentCIS | 7e31892721aa2b3845df3e76296af500f29c9196 | [
"MIT"
] | null | null | null | Simulation_virus_BB.py | Cheese229/DataAssignmentCIS | 7e31892721aa2b3845df3e76296af500f29c9196 | [
"MIT"
] | null | null | null | Simulation_virus_BB.py | Cheese229/DataAssignmentCIS | 7e31892721aa2b3845df3e76296af500f29c9196 | [
"MIT"
] | null | null | null | """
Bigger scale simulation of a virus spread in a city.
This would have been the better opt for the project, as it uses geospatial visualisation (which is not in this code)
and data gathered from a a ride share, a specific city, their population, and their public transport data.
I still don't und... | 34.752577 | 121 | 0.576387 |
import numpy as np
from collections import namedtuple
Param = namedtuple('Param', 'R0 DE DI I0 HopitalisationRate HospitalIters')
def seir(par, distr, flow, alpha, iterations, inf):
r = flow.shape[0]
n = flow.shape[1]
N = distr[0].sum()
Svec = distr[0].copy()
Evec = np.zeros(n)
... | true | true |
f72810ac5161b5ba7e97e6d85881891276be8a01 | 8,975 | py | Python | tests/st/summary/test_summary_collector.py | Greatpanc/mindspore_zhb | c2511f7d6815b9232ac4427e27e2c132ed03e0d9 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/summary/test_summary_collector.py | LaiYongqiang/mindspore | 1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/summary/test_summary_collector.py | LaiYongqiang/mindspore | 1b7a38ccd86b55af50a0ea55c7f2f43813ed3e0e | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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... | 39.537445 | 106 | 0.630641 |
import os
import re
import shutil
import tempfile
from collections import Counter
import pytest
from mindspore import nn, Tensor, context
from mindspore.common.initializer import Normal
from mindspore.nn.metrics import Loss
from mindspore.nn.optim import Momentum
from mindspore.ops import op... | true | true |
f72810def0eca1d7c73b251c7ad71dbceec4eebf | 4,527 | py | Python | EvoCluster/_objectives.py | soumitri2001/EvoCluster | 2f8e3f21c7045478394e7e02a22835f7c184c0c7 | [
"Apache-2.0"
] | 12 | 2019-12-21T16:29:15.000Z | 2022-01-03T01:24:14.000Z | EvoCluster/_objectives.py | soumitri2001/EvoCluster | 2f8e3f21c7045478394e7e02a22835f7c184c0c7 | [
"Apache-2.0"
] | 3 | 2020-06-07T07:52:40.000Z | 2021-10-08T16:13:49.000Z | EvoCluster/_objectives.py | RaneemQaddoura/EvoCluster | 001dfb4c1f00db84ad1c2f2228eed6112d7e65b1 | [
"Apache-2.0"
] | 14 | 2019-12-28T19:55:48.000Z | 2021-12-31T14:46:03.000Z | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 9 18:12:29 2019
@author: Raneem
"""
from sklearn import cluster, metrics
from scipy.spatial.distance import pdist, cdist
import numpy
import sys
def getLabelsPred(startpts, points, k):
labelsPred = [-1] * len(points)
for i in range(len(points)):
di... | 30.18 | 86 | 0.611663 |
from sklearn import cluster, metrics
from scipy.spatial.distance import pdist, cdist
import numpy
import sys
def getLabelsPred(startpts, points, k):
labelsPred = [-1] * len(points)
for i in range(len(points)):
distances = numpy.linalg.norm(points[i]-startpts, axis = 1)
labelsPred[i] = nu... | true | true |
f7281187ed5c880e1f702c2aab3c172b60a8524a | 2,666 | py | Python | response/slack/action_handlers.py | qubitdigital/response | 9ac9d11f60d108739043697aa19478474cb94a09 | [
"MIT"
] | null | null | null | response/slack/action_handlers.py | qubitdigital/response | 9ac9d11f60d108739043697aa19478474cb94a09 | [
"MIT"
] | 9 | 2021-03-19T13:56:39.000Z | 2021-06-10T20:48:16.000Z | response/slack/action_handlers.py | qubitdigital/response | 9ac9d11f60d108739043697aa19478474cb94a09 | [
"MIT"
] | null | null | null | import json
from datetime import datetime
from django.conf import settings
from response.core.models.incident import Incident
from response.slack.settings import INCIDENT_EDIT_DIALOG
from response.slack.dialog_builder import Dialog, Text, TextArea, SelectWithOptions, SelectFromUsers
from response.slack.models import ... | 41.015385 | 199 | 0.749437 | import json
from datetime import datetime
from django.conf import settings
from response.core.models.incident import Incident
from response.slack.settings import INCIDENT_EDIT_DIALOG
from response.slack.dialog_builder import Dialog, Text, TextArea, SelectWithOptions, SelectFromUsers
from response.slack.models import ... | true | true |
f728126172e0b228a0b705f40294c9a3ba4e189a | 12,409 | py | Python | azure-iot-device/tests/common/pipeline/test_pipeline_stages_http.py | olivakar/azure-iot-sdk-python | d8f2403030cf94510d381d8d5ac37af6e8d306f8 | [
"MIT"
] | null | null | null | azure-iot-device/tests/common/pipeline/test_pipeline_stages_http.py | olivakar/azure-iot-sdk-python | d8f2403030cf94510d381d8d5ac37af6e8d306f8 | [
"MIT"
] | null | null | null | azure-iot-device/tests/common/pipeline/test_pipeline_stages_http.py | olivakar/azure-iot-sdk-python | d8f2403030cf94510d381d8d5ac37af6e8d306f8 | [
"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.
# --------------------------------------------------------------------------
import log... | 38.181538 | 153 | 0.6895 |
import logging
import pytest
import sys
import six
from azure.iot.device.common import transport_exceptions, handle_exceptions
from azure.iot.device.common.pipeline import (
pipeline_ops_base,
pipeline_stages_base,
pipeline_ops_http,
pipeline_stages_http,
pipeline_exceptions,
config,
)
from... | true | true |
f7281265449a1193fd08ea906ba96174e969eb2d | 1,914 | py | Python | loadmodel.py | shfshf/seq2annotation | d4bf88a869631b43fa2974c2ffa1c5dd6a7623ed | [
"Apache-2.0"
] | 90 | 2018-11-29T07:05:16.000Z | 2021-11-22T11:32:58.000Z | loadmodel.py | shfshf/seq2annotation | d4bf88a869631b43fa2974c2ffa1c5dd6a7623ed | [
"Apache-2.0"
] | 50 | 2019-06-27T07:11:18.000Z | 2022-02-10T00:01:02.000Z | loadmodel.py | lanSeFangZhou/seq2annotation | a824520d46f0b3d70268fae422976a5ce1b3f4ce | [
"Apache-2.0"
] | 23 | 2019-01-03T14:57:15.000Z | 2022-03-08T07:50:33.000Z | import tensorflow as tf
from tensorflow.python.platform import gfile
# only for bugfix
tf.contrib.rnn
output_graph_path = './model.pb'
graph = tf.Graph()
with gfile.FastGFile(output_graph_path, 'rb') as f:
output_graph_def = tf.GraphDef()
output_graph_def.ParseFromString(f.read())
with graph.... | 36.807692 | 101 | 0.630617 | import tensorflow as tf
from tensorflow.python.platform import gfile
tf.contrib.rnn
output_graph_path = './model.pb'
graph = tf.Graph()
with gfile.FastGFile(output_graph_path, 'rb') as f:
output_graph_def = tf.GraphDef()
output_graph_def.ParseFromString(f.read())
with graph.as_default():
... | true | true |
f72814583f19fdfd0e5564abe74cf6998b30cf8c | 1,766 | py | Python | flowy/swf/history.py | severb/flowy | bb7c7df99b66e5ef8d7806210408487aed9db67a | [
"MIT"
] | 25 | 2015-03-24T08:59:21.000Z | 2021-01-08T13:39:00.000Z | flowy/swf/history.py | pbs/flowy | 9da8d5aa3b1efad84df0589402adeb770a034719 | [
"MIT"
] | 9 | 2015-01-08T04:25:34.000Z | 2016-10-06T08:54:50.000Z | flowy/swf/history.py | pbs/flowy | 9da8d5aa3b1efad84df0589402adeb770a034719 | [
"MIT"
] | 6 | 2015-01-22T08:00:38.000Z | 2021-01-05T20:31:24.000Z | from flowy.swf.decision import task_key, timer_key
class SWFExecutionHistory(object):
def __init__(self, running, timedout, results, errors, order):
self.running = running
self.timedout = timedout
self.results = results
self.errors = errors
self.order_ = order
def is_r... | 30.448276 | 82 | 0.660249 | from flowy.swf.decision import task_key, timer_key
class SWFExecutionHistory(object):
def __init__(self, running, timedout, results, errors, order):
self.running = running
self.timedout = timedout
self.results = results
self.errors = errors
self.order_ = order
def is_r... | true | true |
f728147610d11a90efa14fbb6a821ac73ce691a8 | 1,334 | py | Python | exercises/practice/tree-building/.meta/example.py | samr1ddh1/python-1 | 8998d30bb0d6665dd233354670f21c4d11c2f1a0 | [
"MIT"
] | 1,177 | 2017-06-21T20:24:06.000Z | 2022-03-29T02:30:55.000Z | exercises/practice/tree-building/.meta/example.py | samr1ddh1/python-1 | 8998d30bb0d6665dd233354670f21c4d11c2f1a0 | [
"MIT"
] | 1,890 | 2017-06-18T20:06:10.000Z | 2022-03-31T18:35:51.000Z | exercises/practice/tree-building/.meta/example.py | samr1ddh1/python-1 | 8998d30bb0d6665dd233354670f21c4d11c2f1a0 | [
"MIT"
] | 1,095 | 2017-06-26T23:06:19.000Z | 2022-03-29T03:25:38.000Z | class Record:
def __init__(self, record_id, parent_id):
self.record_id = record_id
self.parent_id = parent_id
def equal_id(self):
return self.record_id == self.parent_id
class Node:
def __init__(self, node_id):
self.node_id = node_id
self.children = []
def valida... | 27.791667 | 81 | 0.654423 | class Record:
def __init__(self, record_id, parent_id):
self.record_id = record_id
self.parent_id = parent_id
def equal_id(self):
return self.record_id == self.parent_id
class Node:
def __init__(self, node_id):
self.node_id = node_id
self.children = []
def valida... | true | true |
f72814a675df3867ed79d00435689d65ca7e9ffb | 1,041 | py | Python | autoio-interfaces/chemkin_io/tests/test__species_write_read.py | lpratalimaffei/autoio | 57be6e4882af1841153c19e7353e2531e64ce47f | [
"Apache-2.0"
] | null | null | null | autoio-interfaces/chemkin_io/tests/test__species_write_read.py | lpratalimaffei/autoio | 57be6e4882af1841153c19e7353e2531e64ce47f | [
"Apache-2.0"
] | 1 | 2022-02-15T19:35:14.000Z | 2022-02-15T19:35:14.000Z | autoio-interfaces/chemkin_io/tests/test__species_write_read.py | lpratalimaffei/autoio | 57be6e4882af1841153c19e7353e2531e64ce47f | [
"Apache-2.0"
] | 13 | 2020-06-24T05:21:11.000Z | 2021-05-05T19:58:30.000Z | """ tests chemkin_io.writer.mechanism.species_block
"""
from chemkin_io.writer.mechanism import species_block as writer
from chemkin_io.parser.species import names as parser
SPC_IDENT_DCT = {
'O': {'smiles': 'smiles_1',
'inchi': 'inchi_1',
'charge': '',
'mult': '',
'sens': ... | 26.025 | 63 | 0.588857 |
from chemkin_io.writer.mechanism import species_block as writer
from chemkin_io.parser.species import names as parser
SPC_IDENT_DCT = {
'O': {'smiles': 'smiles_1',
'inchi': 'inchi_1',
'charge': '',
'mult': '',
'sens': ''},
'H': {'smiles': 'smiles_2',
'inchi': ... | true | true |
f728168bbdf509e74ee76567b7e5122e0bcb5830 | 54 | py | Python | id_roles/__init__.py | W-DEJONG/id-roles | 3a45dc8a72ff434c9c180ddbffee1bd325aaa46c | [
"MIT"
] | null | null | null | id_roles/__init__.py | W-DEJONG/id-roles | 3a45dc8a72ff434c9c180ddbffee1bd325aaa46c | [
"MIT"
] | null | null | null | id_roles/__init__.py | W-DEJONG/id-roles | 3a45dc8a72ff434c9c180ddbffee1bd325aaa46c | [
"MIT"
] | null | null | null | from id_roles.roles import Roles
__all__ = ['Roles']
| 13.5 | 32 | 0.740741 | from id_roles.roles import Roles
__all__ = ['Roles']
| true | true |
f72816c9b2071c96c52217d26c72c08626519960 | 1,635 | py | Python | ch06-sgd/utils.py | GaoX2015/intro_ds | 38e239dcf0fbe4b98ca11534ff419af72417a272 | [
"Apache-2.0"
] | 314 | 2018-02-11T09:44:21.000Z | 2022-03-31T02:55:34.000Z | ch06-sgd/utils.py | jianyigengge/intro_ds | 886e678e5353e9b4c0d4f3da83a00d6b9a2f06a5 | [
"Apache-2.0"
] | 5 | 2018-05-27T07:18:09.000Z | 2019-03-29T14:07:55.000Z | ch06-sgd/utils.py | jianyigengge/intro_ds | 886e678e5353e9b4c0d4f3da83a00d6b9a2f06a5 | [
"Apache-2.0"
] | 262 | 2018-03-20T07:36:22.000Z | 2022-03-08T06:51:58.000Z | # -*- coding: UTF-8 -*-
"""
此脚本用于随机生成线性模型数据、定义模型以及其他工具
"""
import numpy as np
import tensorflow as tf
def generateLinearData(dimension, num):
"""
随机产生线性模型数据
参数
----
dimension :int,自变量个数
num :int,数据个数
返回
----
x :np.array,自变量
y :np.array,因变量
"""
np.random.seed(1024)... | 20.696203 | 80 | 0.619572 |
import numpy as np
import tensorflow as tf
def generateLinearData(dimension, num):
np.random.seed(1024)
beta = np.array(range(dimension)) + 1
x = np.random.random((num, dimension))
epsilon = np.random.random((num, 1))
y = x.dot(beta).reshape((-1, 1)) + epsilon
return x, y
def createL... | true | true |
f72817e33d667fa487e967a902485b50885a9271 | 2,408 | py | Python | mathdecathlon.py | blay800/personal-projects | dea248b3a503a1cc0e620eaa92d347d6e0f645d2 | [
"MIT"
] | null | null | null | mathdecathlon.py | blay800/personal-projects | dea248b3a503a1cc0e620eaa92d347d6e0f645d2 | [
"MIT"
] | null | null | null | mathdecathlon.py | blay800/personal-projects | dea248b3a503a1cc0e620eaa92d347d6e0f645d2 | [
"MIT"
] | null | null | null | name=input('Enter your name to costomize your personal Maths quiz decathlon:')
print(name,"""'s Maths quiz decathlon
Answer as many questions as possible to attain the maximum points""")
print('''USERS MANUAL
OPERATORS:
+ ==- ADDITION
- ==- SUBSTRACTION
x ==- MULTIPLICATION
/ ==- DIVISION''')
r... | 34.4 | 79 | 0.57392 | name=input('Enter your name to costomize your personal Maths quiz decathlon:')
print(name,"""'s Maths quiz decathlon
Answer as many questions as possible to attain the maximum points""")
print('''USERS MANUAL
OPERATORS:
+ ==- ADDITION
- ==- SUBSTRACTION
x ==- MULTIPLICATION
/ ==- DIVISION''')
r... | true | true |
f728184d482c02a5a1840ed94d4ff8a633201db2 | 6,204 | py | Python | federated_learning/FedaGrac/param_server.py | HarliWu/From-Deterioration-to-Acceleration-A-Calibration-Approach-to-Rehabilitating-Step-Asynchronism-in-Fe | 3a2f7196a2ca0446ce7ff7c8d15a0fa56a1d91d4 | [
"MIT"
] | null | null | null | federated_learning/FedaGrac/param_server.py | HarliWu/From-Deterioration-to-Acceleration-A-Calibration-Approach-to-Rehabilitating-Step-Asynchronism-in-Fe | 3a2f7196a2ca0446ce7ff7c8d15a0fa56a1d91d4 | [
"MIT"
] | null | null | null | federated_learning/FedaGrac/param_server.py | HarliWu/From-Deterioration-to-Acceleration-A-Calibration-Approach-to-Rehabilitating-Step-Asynchronism-in-Fe | 3a2f7196a2ca0446ce7ff7c8d15a0fa56a1d91d4 | [
"MIT"
] | null | null | null | import time, os, json, time
import numpy as np
import torch
from torch._C import device
import torch.distributed as dist
from torch.autograd import Variable
def test_model(model, test_data, dev):
correct, total = 0, 0
model.eval()
with torch.no_grad():
for data, target in test_data:
d... | 43.083333 | 162 | 0.653127 | import time, os, json, time
import numpy as np
import torch
from torch._C import device
import torch.distributed as dist
from torch.autograd import Variable
def test_model(model, test_data, dev):
correct, total = 0, 0
model.eval()
with torch.no_grad():
for data, target in test_data:
d... | true | true |
f72818f01aa173045e65dadc934e5291bffadedc | 898 | py | Python | doc/print_errors.py | stefsmeets/pyvista | 06b1ac01214a4c636395f139b681acea2543960c | [
"MIT"
] | 1,107 | 2019-05-13T06:40:26.000Z | 2022-03-31T22:16:32.000Z | doc/print_errors.py | stefsmeets/pyvista | 06b1ac01214a4c636395f139b681acea2543960c | [
"MIT"
] | 1,709 | 2019-05-13T05:52:42.000Z | 2022-03-31T18:16:53.000Z | doc/print_errors.py | stefsmeets/pyvista | 06b1ac01214a4c636395f139b681acea2543960c | [
"MIT"
] | 225 | 2019-05-16T04:24:20.000Z | 2022-03-31T18:14:02.000Z | """Read errors output from a sphinx build and remove duplicate groups"""
import os
import pathlib
import sys
sys.tracebacklimit = 0
my_path = pathlib.Path(__file__).parent.resolve()
errors = set()
error_file = os.path.join(my_path, 'build_errors.txt')
if os.path.isfile(error_file):
with open(error_file) as fid:
... | 26.411765 | 77 | 0.61804 | import os
import pathlib
import sys
sys.tracebacklimit = 0
my_path = pathlib.Path(__file__).parent.resolve()
errors = set()
error_file = os.path.join(my_path, 'build_errors.txt')
if os.path.isfile(error_file):
with open(error_file) as fid:
group = []
for line in fid.readlines():
line =... | true | true |
f728191ba7a438605552750ad6806ecd257df742 | 64,373 | py | Python | fpga_interchange/populate_chip_info.py | litghost/python-fpga-interchange | 3809a19f2f9cf80f014e439f9ae8643543c4519f | [
"0BSD"
] | null | null | null | fpga_interchange/populate_chip_info.py | litghost/python-fpga-interchange | 3809a19f2f9cf80f014e439f9ae8643543c4519f | [
"0BSD"
] | null | null | null | fpga_interchange/populate_chip_info.py | litghost/python-fpga-interchange | 3809a19f2f9cf80f014e439f9ae8643543c4519f | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
from enum import Enum
from collections import ... | 38.477585 | 157 | 0.614776 |
from enum import Enum
from collections import namedtuple
from fpga_interchange.chip_info import ChipInfo, BelInfo, TileTypeInfo, \
TileWireInfo, BelPort, PipInfo, TileInstInfo, SiteInstInfo, NodeInfo, \
TileWireRef, CellBelMap, ParameterPins, CellBelPin, ConstraintTag, \
CellConstrain... | true | true |
f728195dd339d5267c7cae73f82a8afac42ab3cb | 951 | py | Python | src/transformers/data/__init__.py | coda-nsit/transformers | 372a9c6e633945b817f02de410923eec4dc18eed | [
"Apache-2.0"
] | null | null | null | src/transformers/data/__init__.py | coda-nsit/transformers | 372a9c6e633945b817f02de410923eec4dc18eed | [
"Apache-2.0"
] | null | null | null | src/transformers/data/__init__.py | coda-nsit/transformers | 372a9c6e633945b817f02de410923eec4dc18eed | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
from .metrics import is_sklearn_available
from .processors import (
DataProcessor,
InputExample,
InputFeatures,
SingleSentenceClassif... | 26.416667 | 93 | 0.769716 |
# module, but to preserve other warnings. So, don't check this module at all.
from .metrics import is_sklearn_available
from .processors import (
DataProcessor,
InputExample,
InputFeatures,
SingleSentenceClassificationProcessor,
SquadExample,
SquadFeatures,
SquadV1Processor,
SquadV2Pr... | true | true |
f72819c4e5b102864fd8cec7ae952001c8bfbdd6 | 189,788 | py | Python | source/gui/settingsDialogs.py | meunice/nvda | ba42885c0aaf7f695a088ab856fb350faf26a2dc | [
"bzip2-1.0.6"
] | null | null | null | source/gui/settingsDialogs.py | meunice/nvda | ba42885c0aaf7f695a088ab856fb350faf26a2dc | [
"bzip2-1.0.6"
] | null | null | null | source/gui/settingsDialogs.py | meunice/nvda | ba42885c0aaf7f695a088ab856fb350faf26a2dc | [
"bzip2-1.0.6"
] | null | null | null | # -*- coding: UTF-8 -*-
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2020 NV Access Limited, Peter Vágner, Aleksey Sadovoy,
# Rui Batista, Joseph Lee, Heiko Folkerts, Zahari Yurukov, Leonard de Ruijter,
# Derek Riemer, Babbage B.V., Davy Kager, Ethan Holliger, Bill Dengler, Thomas Stivers
# Thi... | 45.64406 | 262 | 0.76116 |
import logging
from abc import ABCMeta
import copy
import wx
from vision.providerBase import VisionEnhancementProviderSettings
from wx.lib import scrolledpanel
from wx.lib.expando import ExpandoTextCtrl
import wx.lib.newevent
import winUser
import logHandler
import installer
from synthDriverHandler ... | true | true |
f72819ff76d7fcc07036a600247241e818622725 | 2,222 | py | Python | ckanext/harvest/logic/action/patch.py | alphagov-mirror/ckanext-harvest | be4d134cf2e4d4548c67dc2f61b200948f0f74e0 | [
"PostgreSQL"
] | 86 | 2015-01-09T19:21:20.000Z | 2022-03-23T07:17:27.000Z | ckanext/harvest/logic/action/patch.py | alphagov-mirror/ckanext-harvest | be4d134cf2e4d4548c67dc2f61b200948f0f74e0 | [
"PostgreSQL"
] | 319 | 2015-01-13T13:40:08.000Z | 2022-03-24T12:13:42.000Z | ckanext/harvest/logic/action/patch.py | alphagov-mirror/ckanext-harvest | be4d134cf2e4d4548c67dc2f61b200948f0f74e0 | [
"PostgreSQL"
] | 154 | 2015-01-13T21:06:03.000Z | 2022-03-15T12:10:57.000Z | '''API functions for partial updates of existing data in CKAN'''
import logging
from ckan.logic import get_action
from ckanext.harvest.utils import (
DATASET_TYPE_NAME
)
log = logging.getLogger(__name__)
def harvest_source_patch(context, data_dict):
'''
Patch an existing harvest source
This method ... | 34.71875 | 78 | 0.69982 |
import logging
from ckan.logic import get_action
from ckanext.harvest.utils import (
DATASET_TYPE_NAME
)
log = logging.getLogger(__name__)
def harvest_source_patch(context, data_dict):
log.info('Patch harvest source: %r', data_dict)
data_dict['type'] = DATASET_TYPE_NAME
context['extras_as_string']... | true | true |
f7281be3f98ed8313aadea4a83e9992b64fdadbd | 4,090 | py | Python | src/analysis.py | alexissavva/NLP | 100963e96ebd6aae26027c2f13f42675dbd5ed9f | [
"MIT"
] | 31 | 2019-07-28T07:56:29.000Z | 2022-03-24T17:54:11.000Z | src/analysis.py | alexissavva/NLP | 100963e96ebd6aae26027c2f13f42675dbd5ed9f | [
"MIT"
] | 10 | 2020-08-04T05:07:32.000Z | 2021-11-27T17:00:58.000Z | src/analysis.py | alexissavva/NLP | 100963e96ebd6aae26027c2f13f42675dbd5ed9f | [
"MIT"
] | 22 | 2019-06-11T14:56:55.000Z | 2021-11-04T13:01:33.000Z | """ Usage:
<file-name> --in=IN_FILE --out=OUT_FILE [--debug]
"""
# External imports
import logging
import pdb
from pprint import pprint
from pprint import pformat
from docopt import docopt
from collections import defaultdict
from operator import itemgetter
from tqdm import tqdm
# Local imports
#=-----
def get_pr... | 34.083333 | 122 | 0.555746 |
import logging
import pdb
from pprint import pprint
from pprint import pformat
from docopt import docopt
from collections import defaultdict
from operator import itemgetter
from tqdm import tqdm
def get_predicted_gender(spanish_sent):
first_word = spanish_sent.split()[0].lower()
if first_word == "el":
... | true | true |
f7281cc044cecdc1098a7431b35e25e75a807124 | 607 | py | Python | freebsd-port/files/patch-nodocs-setup.py | ShaneMcC/hellanzb | 5ea4e5e73108f80645758b91b0596b6a4a739c6c | [
"BSD-3-Clause"
] | 11 | 2015-01-03T09:52:23.000Z | 2022-01-22T14:33:05.000Z | freebsd-port/files/patch-nodocs-setup.py | ShaneMcC/hellanzb | 5ea4e5e73108f80645758b91b0596b6a4a739c6c | [
"BSD-3-Clause"
] | null | null | null | freebsd-port/files/patch-nodocs-setup.py | ShaneMcC/hellanzb | 5ea4e5e73108f80645758b91b0596b6a4a739c6c | [
"BSD-3-Clause"
] | 6 | 2015-02-05T21:37:17.000Z | 2021-09-07T14:05:46.000Z | --- setup.py.orig Mon Feb 19 18:12:55 2007
+++ setup.py Wed Feb 21 16:34:28 2007
@@ -38,8 +38,7 @@
packages = [ 'Hellanzb', 'Hellanzb.NZBLeecher', 'Hellanzb.HellaXMLRPC',
'Hellanzb.external', 'Hellanzb.external.elementtree' ],
scripts = [ 'hellanzb.py' ],
- data_files = [ ... | 46.692308 | 100 | 0.522241 | --- setup.py.orig Mon Feb 19 18:12:55 2007
+++ setup.py Wed Feb 21 16:34:28 2007
@@ -38,8 +38,7 @@
packages = [ 'Hellanzb', 'Hellanzb.NZBLeecher', 'Hellanzb.HellaXMLRPC',
'Hellanzb.external', 'Hellanzb.external.elementtree' ],
scripts = [ 'hellanzb.py' ],
- data_files = [ ... | false | true |
f7281ccc6ccc63337bc1c58b6dcc69dfa0697200 | 4,863 | py | Python | lex2/textio/_textio.py | DeltaRazero/liblexer2-python3 | 43a1a63ee005da8a6936665cb27f4ced8158ed6c | [
"Zlib"
] | 1 | 2020-10-31T13:14:45.000Z | 2020-10-31T13:14:45.000Z | lex2/textio/_textio.py | DeltaRazero/liblexer2-python3 | 43a1a63ee005da8a6936665cb27f4ced8158ed6c | [
"Zlib"
] | 4 | 2020-10-28T16:21:22.000Z | 2020-11-09T21:02:33.000Z | lex2/textio/_textio.py | DeltaRazero/liblexer2-python3 | 43a1a63ee005da8a6936665cb27f4ced8158ed6c | [
"Zlib"
] | null | null | null | """<internal>"""
'''
zlib License
(C) 2020-2022 DeltaRazero
All rights reserved.
'''
# ***************************************************************************************
class __:
'<imports>'
import abc
import pathlib as pl
import typing as t
from ._textstream_core import (
IText... | 26.57377 | 91 | 0.518816 |
class __:
import abc
import pathlib as pl
import typing as t
from ._textstream_core import (
ITextstream,
)
from ._textstream_disk import TextstreamDisk
from ._textstream_memory import TextstreamMemory
DEFAULT_BUFFER_SIZE = 512
class ITextIO (metaclass=__.abc.ABCMeta)... | true | true |
f7281dac5e5a7e5ce0b63cfef01552f0e5f84e37 | 2,401 | py | Python | install.py | LucXyMan/starseeker | b5c3365514c982734da7d95621e6b85af550ce82 | [
"BSD-3-Clause"
] | null | null | null | install.py | LucXyMan/starseeker | b5c3365514c982734da7d95621e6b85af550ce82 | [
"BSD-3-Clause"
] | null | null | null | install.py | LucXyMan/starseeker | b5c3365514c982734da7d95621e6b85af550ce82 | [
"BSD-3-Clause"
] | 1 | 2019-11-27T18:00:00.000Z | 2019-11-27T18:00:00.000Z | #!/usr/bin/env python2.7
# -*- coding:UTF-8 -*-2
u"""install.py
Copyright (c) 2019 Yukio Kuro
This software is released under BSD license.
Linux用インストーラ。
"""
import os as __os
import sys as __sys
import shutil as __shutil
__shell_script = __os.path.join(__sys.exec_prefix, "games", "starseeker")
__icon = __os.path.join... | 30.0125 | 78 | 0.636401 |
u"""install.py
Copyright (c) 2019 Yukio Kuro
This software is released under BSD license.
Linux用インストーラ。
"""
import os as __os
import sys as __sys
import shutil as __shutil
__shell_script = __os.path.join(__sys.exec_prefix, "games", "starseeker")
__icon = __os.path.join(__sys.exec_prefix, "share", "icons", "starseek... | false | true |
f7281db02a76f0dac13b9c843ff0c6e71debf922 | 20,449 | py | Python | tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py | echo80313/grpc | 93cdc8b77e7b3fe4a3afec1c9c7e29b3f02ec3cf | [
"Apache-2.0"
] | null | null | null | tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py | echo80313/grpc | 93cdc8b77e7b3fe4a3afec1c9c7e29b3f02ec3cf | [
"Apache-2.0"
] | 4 | 2022-02-27T18:59:37.000Z | 2022-02-27T18:59:53.000Z | tools/run_tests/xds_k8s_test_driver/framework/xds_url_map_testcase.py | echo80313/grpc | 93cdc8b77e7b3fe4a3afec1c9c7e29b3f02ec3cf | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 42.691023 | 115 | 0.627366 |
import abc
from dataclasses import dataclass
import datetime
import json
import os
import re
import sys
import time
from typing import Any, Iterable, Mapping, Optional, Tuple
import unittest
from absl import flags
from absl import logging
from absl.testing import absltest
from google.protobuf import json... | true | true |
f7281ea47705ab62937db90e4ddff340c29763a6 | 196 | py | Python | setup.py | aakinlalu/my-data-science-template | 4126938ac2203aac9e6ab3b7d92c3f2c74203bee | [
"FTL"
] | null | null | null | setup.py | aakinlalu/my-data-science-template | 4126938ac2203aac9e6ab3b7d92c3f2c74203bee | [
"FTL"
] | null | null | null | setup.py | aakinlalu/my-data-science-template | 4126938ac2203aac9e6ab3b7d92c3f2c74203bee | [
"FTL"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.0.1',
description='to classify crime',
author='Adebayo',
license='',
)
| 17.818182 | 43 | 0.647959 | from setuptools import find_packages, setup
setup(
name='src',
packages=find_packages(),
version='0.0.1',
description='to classify crime',
author='Adebayo',
license='',
)
| true | true |
f7281f6965f2c2e3ad5eb6944d0956b099447978 | 10,060 | py | Python | bay/cli/tasks.py | eventbrite/bay | 3a157457a55713067213aeafe385a1cc49aa2698 | [
"Apache-2.0"
] | 22 | 2017-03-01T19:52:30.000Z | 2020-09-09T16:27:21.000Z | bay/cli/tasks.py | eventbrite/bay | 3a157457a55713067213aeafe385a1cc49aa2698 | [
"Apache-2.0"
] | 25 | 2017-02-23T23:08:56.000Z | 2019-10-09T00:02:52.000Z | bay/cli/tasks.py | eventbrite/bay | 3a157457a55713067213aeafe385a1cc49aa2698 | [
"Apache-2.0"
] | 4 | 2017-03-12T03:51:17.000Z | 2021-09-08T11:36:36.000Z | import contextlib
import shutil
import threading
import time
from .colors import CYAN, GREEN, RED, YELLOW
from ..utils.threading import ExceptionalThread
UP_ONE = "\033[A\033[1000D"
CLEAR_LINE = "\033[2K"
console_lock = threading.Lock()
class Task:
"""
Something that can be started (by being created), hav... | 35.052265 | 116 | 0.584195 | import contextlib
import shutil
import threading
import time
from .colors import CYAN, GREEN, RED, YELLOW
from ..utils.threading import ExceptionalThread
UP_ONE = "\033[A\033[1000D"
CLEAR_LINE = "\033[2K"
console_lock = threading.Lock()
class Task:
INDENT_AMOUNT = 2
FLAVOR_NEUTRAL = "neutral"
FLAVOR... | true | true |
f7281febef4aa8e8a1378bda0f0d3af1f2537596 | 5,092 | py | Python | ex1/daniel/imu_exercise_kalman.py | balintmaci/drone_intro_exercises | 1d8b839fecd6b0c5e33210b9a88fd741a71034cc | [
"Unlicense"
] | null | null | null | ex1/daniel/imu_exercise_kalman.py | balintmaci/drone_intro_exercises | 1d8b839fecd6b0c5e33210b9a88fd741a71034cc | [
"Unlicense"
] | null | null | null | ex1/daniel/imu_exercise_kalman.py | balintmaci/drone_intro_exercises | 1d8b839fecd6b0c5e33210b9a88fd741a71034cc | [
"Unlicense"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# IMU exercise
# Copyright (c) 2015-2020 Kjeld Jensen kjen@mmmi.sdu.dk kj@kjen.dk
# import libraries
from math import pi, sqrt, atan2
import matplotlib.pyplot as plt
from pylab import ion
# name of the file to read ##
fileName = 'imu_razor_data_pitch_55deg.txt'
## IMU type
... | 26.112821 | 70 | 0.685389 |
from math import pi, sqrt, atan2
import matplotlib.pyplot as plt
from pylab import ion
leName = 'imu_razor_data_pitch_55deg.txt'
= 'sparkfun_razor'
showPlot = True
show3DLiveView = False
show3DLiveViewInterval = 3
if show3DLiveView == True:
from imu_box3d import imu_visualize
| true | true |
f7282111b09b84725bdd3773686ead033acf9be7 | 411 | py | Python | PlagiarismChecker/asgi.py | Esatyilmaz0/PlagiarismChecker | 1d345d131b69873e2238ac798d8cb142768ccb54 | [
"MIT"
] | null | null | null | PlagiarismChecker/asgi.py | Esatyilmaz0/PlagiarismChecker | 1d345d131b69873e2238ac798d8cb142768ccb54 | [
"MIT"
] | 2 | 2021-03-19T04:20:41.000Z | 2021-04-08T20:48:36.000Z | PlagiarismChecker/asgi.py | Esatyilmaz0/PlagiarismChecker | 1d345d131b69873e2238ac798d8cb142768ccb54 | [
"MIT"
] | null | null | null | """
ASGI config for PlagiarismChecker project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJ... | 24.176471 | 78 | 0.79562 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'PlagiarismChecker.settings')
application = get_asgi_application()
| true | true |
f728212b851b7dbf65eadaf764ba43a74ab02d53 | 9,854 | py | Python | NeuralNetwok/NeuralNetwork.py | CanyellWang/MachineLearning_Python_wchy | d611538cdad31ab257baf837091f1dde2c3be5ec | [
"MIT"
] | 1 | 2018-07-07T08:32:18.000Z | 2018-07-07T08:32:18.000Z | NeuralNetwok/NeuralNetwork.py | EnochMHforever/MachineLearning_Python | 7eac77f7446a0c69bfb1a8be7da405895409d131 | [
"MIT"
] | null | null | null | NeuralNetwok/NeuralNetwork.py | EnochMHforever/MachineLearning_Python | 7eac77f7446a0c69bfb1a8be7da405895409d131 | [
"MIT"
] | 1 | 2020-09-29T14:10:27.000Z | 2020-09-29T14:10:27.000Z | #-*- coding: utf-8 -*-
import numpy as np
from scipy import io as spio
from matplotlib import pyplot as plt
from scipy import optimize
from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r"c:\windows\fonts\simsun.ttc", size=14) # 解决windows环境下画图汉字乱码问题
from sklearn import datasets
from skle... | 37.045113 | 211 | 0.631926 |
import numpy as np
from scipy import io as spio
from matplotlib import pyplot as plt
from scipy import optimize
from matplotlib.font_manager import FontProperties
font = FontProperties(fname=r"c:\windows\fonts\simsun.ttc", size=14)
from sklearn import datasets
from sklearn.preprocessing import StandardScaler
impo... | true | true |
f7282351d781e1b75efa07300992ceeacde4022a | 13,387 | py | Python | 1021/tspomp/M2s.py | Kurogi-Lab/CAN2 | abd029895f2ff9d1c8debdb3825b0d4b9314d136 | [
"CECILL-B"
] | null | null | null | 1021/tspomp/M2s.py | Kurogi-Lab/CAN2 | abd029895f2ff9d1c8debdb3825b0d4b9314d136 | [
"CECILL-B"
] | null | null | null | 1021/tspomp/M2s.py | Kurogi-Lab/CAN2 | abd029895f2ff9d1c8debdb3825b0d4b9314d136 | [
"CECILL-B"
] | 1 | 2020-12-01T00:54:18.000Z | 2020-12-01T00:54:18.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd #for pandas see http://keisanbutsuriya.hateblo.jp/entry/201\
import argparse
import numpy as np
import math
import subprocess
import glob
import os
#from matplotlib import pylab as plt
import matplotlib.pyplot as plt
from numpy.lib.stride_tricks import a... | 42.907051 | 287 | 0.577127 |
import pandas as pd
import argparse
import numpy as np
import math
import subprocess
import glob
import os
import matplotlib.pyplot as plt
from numpy.lib.stride_tricks import as_strided
import mylib
import time
import datetime
import sys
Sa=['fhs', 'fms', 'mkk', 'mko','mmt','mnh','mym']
La=[1,2,3,4,5,6,7,8,9,10]
D... | false | true |
f7282387d0e5f482087a84e3bc3f9fa8b9da6a4d | 2,948 | py | Python | httpie/config.py | Natim/httpie | 9fbe745987cd4faca843f9442e0240f84fcfff43 | [
"BSD-3-Clause"
] | 7 | 2017-08-03T03:11:44.000Z | 2022-03-25T14:52:52.000Z | httpie/config.py | Natim/httpie | 9fbe745987cd4faca843f9442e0240f84fcfff43 | [
"BSD-3-Clause"
] | 1 | 2017-01-09T12:45:19.000Z | 2017-01-09T12:52:06.000Z | httpie/config.py | Natim/httpie | 9fbe745987cd4faca843f9442e0240f84fcfff43 | [
"BSD-3-Clause"
] | 7 | 2016-09-07T10:08:59.000Z | 2017-05-17T08:06:45.000Z | import os
import json
import errno
from httpie import __version__
from httpie.compat import is_windows
DEFAULT_CONFIG_DIR = str(os.environ.get(
'HTTPIE_CONFIG_DIR',
os.path.expanduser('~/.httpie') if not is_windows else
os.path.expandvars(r'%APPDATA%\\httpie')
))
class BaseConfigDict(dict):
name =... | 26.088496 | 75 | 0.552917 | import os
import json
import errno
from httpie import __version__
from httpie.compat import is_windows
DEFAULT_CONFIG_DIR = str(os.environ.get(
'HTTPIE_CONFIG_DIR',
os.path.expanduser('~/.httpie') if not is_windows else
os.path.expandvars(r'%APPDATA%\\httpie')
))
class BaseConfigDict(dict):
name =... | true | true |
f72823ae3f47dd0ed7719b074a8c86ef154f4075 | 16,177 | py | Python | ckanext/multilingual/plugin.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | 58 | 2015-01-11T09:05:15.000Z | 2022-03-17T23:44:07.000Z | ckanext/multilingual/plugin.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | 1,467 | 2015-01-01T16:47:44.000Z | 2022-02-28T16:51:20.000Z | ckanext/multilingual/plugin.py | cascaoSDC/ckan | 75a08caa7c688ce70229dfea7070cc667a15c5e8 | [
"BSD-3-Clause"
] | 17 | 2015-05-06T14:04:21.000Z | 2021-11-11T19:58:16.000Z | # encoding: utf-8
import six
from six import string_types
import ckan
from ckan.plugins import SingletonPlugin, implements, IPackageController
from ckan.plugins import IGroupController, IOrganizationController, ITagController, IResourceController
from ckan.common import request, config, c
from ckan.logic import get_... | 39.456098 | 103 | 0.614885 |
import six
from six import string_types
import ckan
from ckan.plugins import SingletonPlugin, implements, IPackageController
from ckan.plugins import IGroupController, IOrganizationController, ITagController, IResourceController
from ckan.common import request, config, c
from ckan.logic import get_action
try:
... | true | true |
f72824c53c0c29f77fd3d7d7ea46704e9cd596b6 | 765 | py | Python | libcst/tests/test_tabs.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | 3 | 2021-03-29T19:21:08.000Z | 2021-12-31T09:30:11.000Z | libcst/tests/test_tabs.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | 1 | 2021-08-20T19:03:09.000Z | 2021-08-20T19:03:09.000Z | libcst/tests/test_tabs.py | hauntsaninja/LibCST | c023fa7c4caff3fd2b3946080f9a58b539b10363 | [
"Apache-2.0"
] | 3 | 2020-08-04T02:48:32.000Z | 2020-08-17T01:20:09.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from libcst._tabs import expand_tabs
from libcst.testing.utils import UnitTest, data_provider
class ExpandTabsTest(UnitTest):
@data_prov... | 30.6 | 65 | 0.524183 |
from libcst._tabs import expand_tabs
from libcst.testing.utils import UnitTest, data_provider
class ExpandTabsTest(UnitTest):
@data_provider(
[
("\t", " " * 8),
("\t\t", " " * 16),
(" \t", " " * 8),
("\t ", " " * 12),
("abcd\t", "abcd ... | true | true |
f728251641a661470d18227b859c49eb3a912a2b | 2,518 | py | Python | timer2.py | erictzimas/alarm | bb669ee365bb150c58d5629036b0447dedb5897e | [
"MIT"
] | null | null | null | timer2.py | erictzimas/alarm | bb669ee365bb150c58d5629036b0447dedb5897e | [
"MIT"
] | null | null | null | timer2.py | erictzimas/alarm | bb669ee365bb150c58d5629036b0447dedb5897e | [
"MIT"
] | null | null | null | from tkinter import *
import time
import os
from time import strftime
LARGE_FONT= ("Verdana", 12)
NORM_FONT = ("Helvetica", 10)
SMALL_FONT = ("Helvetica", 8)
global c
c = -1
global count
global solve
count = 0
counti = 0
def clicked():
global count
global secs
count += 1
secs=int(hms_to_seconds(te.get... | 19.826772 | 60 | 0.589357 | from tkinter import *
import time
import os
from time import strftime
LARGE_FONT= ("Verdana", 12)
NORM_FONT = ("Helvetica", 10)
SMALL_FONT = ("Helvetica", 8)
global c
c = -1
global count
global solve
count = 0
counti = 0
def clicked():
global count
global secs
count += 1
secs=int(hms_to_seconds(te.get... | true | true |
f728256f79b38f0f486a2e40550daf6dcc86f2fd | 684 | py | Python | lab/pytest/test_exercise_4.py | Christopher-MakeSchool/SPD-2.31-Testing-and-Architecture | 565f2d3c68c90f2d0aea2101dc6ad7f18b1c6c84 | [
"MIT"
] | null | null | null | lab/pytest/test_exercise_4.py | Christopher-MakeSchool/SPD-2.31-Testing-and-Architecture | 565f2d3c68c90f2d0aea2101dc6ad7f18b1c6c84 | [
"MIT"
] | null | null | null | lab/pytest/test_exercise_4.py | Christopher-MakeSchool/SPD-2.31-Testing-and-Architecture | 565f2d3c68c90f2d0aea2101dc6ad7f18b1c6c84 | [
"MIT"
] | null | null | null | # Test Exercise 4
import pytest
import math
from exercise_4 import extract_position
def test_extract_position():
assert extract_position(
'|error| numerical calculations could not converge.') == None
assert extract_position(
'|debug| numerical calculations could not converge.') == None
ass... | 38 | 95 | 0.709064 |
import pytest
import math
from exercise_4 import extract_position
def test_extract_position():
assert extract_position(
'|error| numerical calculations could not converge.') == None
assert extract_position(
'|debug| numerical calculations could not converge.') == None
assert extract_posit... | true | true |
f72825b2522e09425a65482d219fd6fa130dbc48 | 1,046 | py | Python | openapi_core/deserializing/parameters/factories.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 160 | 2017-11-20T13:39:04.000Z | 2022-03-31T14:48:27.000Z | openapi_core/deserializing/parameters/factories.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 384 | 2017-09-21T12:42:31.000Z | 2022-03-21T17:21:05.000Z | openapi_core/deserializing/parameters/factories.py | Yarn-e/openapi-core | fda9fbd3bc1c0879818e00445e1ad0731f80b065 | [
"BSD-3-Clause"
] | 100 | 2017-11-21T08:07:01.000Z | 2022-01-20T20:32:52.000Z | from functools import partial
from openapi_core.deserializing.parameters.deserializers import (
CallableParameterDeserializer,
)
from openapi_core.deserializing.parameters.deserializers import (
UnsupportedStyleDeserializer,
)
from openapi_core.deserializing.parameters.util import split
from openapi_core.schem... | 32.6875 | 72 | 0.739006 | from functools import partial
from openapi_core.deserializing.parameters.deserializers import (
CallableParameterDeserializer,
)
from openapi_core.deserializing.parameters.deserializers import (
UnsupportedStyleDeserializer,
)
from openapi_core.deserializing.parameters.util import split
from openapi_core.schem... | true | true |
f72825e37db91a57dd111e97a492ed1ccc432677 | 1,560 | py | Python | app/models.py | wenzizone/simple-cmdb | 03e6c005e9e860531ffed72aacaf1ebf8c666035 | [
"Apache-2.0"
] | null | null | null | app/models.py | wenzizone/simple-cmdb | 03e6c005e9e860531ffed72aacaf1ebf8c666035 | [
"Apache-2.0"
] | null | null | null | app/models.py | wenzizone/simple-cmdb | 03e6c005e9e860531ffed72aacaf1ebf8c666035 | [
"Apache-2.0"
] | 1 | 2016-05-31T07:43:53.000Z | 2016-05-31T07:43:53.000Z | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.
# 服务器所在机房
class Cloud(models.Model):
name = models.CharField(max_length=50)
comments = models.CharField(max_length=255, null=True)
# def __unicode__(self):
# return u'%d %s %s'... | 28.363636 | 78 | 0.705769 |
from __future__ import unicode_literals
from django.db import models
class Cloud(models.Model):
name = models.CharField(max_length=50)
comments = models.CharField(max_length=255, null=True)
class Product(models.Model):
name = models.CharField(max_length=50)
subproduct = models.Char... | true | true |
f728269ce204904ddcf8174f285421600acaf66c | 286 | py | Python | setup.py | zaherweb/webcolors | e98b0827964e7fceab81561673354bee972440bf | [
"BSD-3-Clause"
] | 101 | 2015-04-07T22:26:04.000Z | 2022-03-31T21:13:07.000Z | setup.py | JeremyDemers/webcolors | 7950574f67eb156c0b5ae2a884652b7ab29f92f6 | [
"BSD-3-Clause"
] | 12 | 2015-06-07T00:19:51.000Z | 2021-08-02T18:31:44.000Z | setup.py | JeremyDemers/webcolors | 7950574f67eb156c0b5ae2a884652b7ab29f92f6 | [
"BSD-3-Clause"
] | 22 | 2016-04-29T18:28:56.000Z | 2022-03-16T08:54:17.000Z | from glob import glob
from os.path import basename, splitext
from setuptools import find_packages, setup
setup(
packages=find_packages("src"),
package_dir={"": "src"},
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
python_requires=">=3.5,",
)
| 22 | 74 | 0.688811 | from glob import glob
from os.path import basename, splitext
from setuptools import find_packages, setup
setup(
packages=find_packages("src"),
package_dir={"": "src"},
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
python_requires=">=3.5,",
)
| true | true |
f72827bfdd4377187c67cafc843a1a332d35b2e2 | 18,433 | py | Python | pyprob/nn/dataset.py | bayesianbrad/pyprob | a426fc51c1d6da13052979c21af447f9c4023642 | [
"BSD-2-Clause"
] | 1 | 2019-09-21T21:37:50.000Z | 2019-09-21T21:37:50.000Z | pyprob/nn/dataset.py | bayesianbrad/pyprob | a426fc51c1d6da13052979c21af447f9c4023642 | [
"BSD-2-Clause"
] | null | null | null | pyprob/nn/dataset.py | bayesianbrad/pyprob | a426fc51c1d6da13052979c21af447f9c4023642 | [
"BSD-2-Clause"
] | null | null | null | import torch
from torch.utils.data import Dataset, ConcatDataset, Sampler
import torch.distributed as dist
import math
import os
import sys
import shelve
from glob import glob
import numpy as np
import uuid
from termcolor import colored
from collections import Counter, OrderedDict
import random
from .. import util
fro... | 46.197995 | 264 | 0.632615 | import torch
from torch.utils.data import Dataset, ConcatDataset, Sampler
import torch.distributed as dist
import math
import os
import sys
import shelve
from glob import glob
import numpy as np
import uuid
from termcolor import colored
from collections import Counter, OrderedDict
import random
from .. import util
fro... | true | true |
f72828788d1ad9cd20a5b3b3b4fd765d532bed8c | 5,084 | py | Python | day18/test_lib.py | heijp06/AoC-2021 | f6afead5e1fe9a839d608a5792f84e54803742c1 | [
"MIT"
] | null | null | null | day18/test_lib.py | heijp06/AoC-2021 | f6afead5e1fe9a839d608a5792f84e54803742c1 | [
"MIT"
] | null | null | null | day18/test_lib.py | heijp06/AoC-2021 | f6afead5e1fe9a839d608a5792f84e54803742c1 | [
"MIT"
] | null | null | null | import pytest
from lib import part1, part2, sum_list
from snailfish import Parser, RootSnailFish, Snailfish, ValueSnailfish, parse
from functools import reduce
def test_part1():
assert part1(data) == 4140
def test_part2():
assert part2(data) == 3993
@pytest.mark.parametrize(["row", "expected"], (
("1"... | 27.934066 | 81 | 0.426436 | import pytest
from lib import part1, part2, sum_list
from snailfish import Parser, RootSnailFish, Snailfish, ValueSnailfish, parse
from functools import reduce
def test_part1():
assert part1(data) == 4140
def test_part2():
assert part2(data) == 3993
@pytest.mark.parametrize(["row", "expected"], (
("1"... | true | true |
f728291c9bf908695b13e8fe19d70230254fe714 | 9,815 | py | Python | reports/configs/only_logs_dmpnn4_1/other_config.py | hengwei-chan/graph_network_demo | 542f2a59b1b9708abdc718d77db7111f3ba2df96 | [
"MIT"
] | 1 | 2021-10-18T03:44:53.000Z | 2021-10-18T03:44:53.000Z | reports/configs/only_logs_dmpnn4_1/other_config.py | hengwei-chan/graph_network_demo | 542f2a59b1b9708abdc718d77db7111f3ba2df96 | [
"MIT"
] | null | null | null | reports/configs/only_logs_dmpnn4_1/other_config.py | hengwei-chan/graph_network_demo | 542f2a59b1b9708abdc718d77db7111f3ba2df96 | [
"MIT"
] | 1 | 2022-02-22T08:32:01.000Z | 2022-02-22T08:32:01.000Z | from dataclasses import dataclass, field
from typing import List
import tensorflow as tf
from graph_networks.utilities import *
import logging
import os
ATOM_FEATURE_DIM = DGIN4_ATOM_FEATURE_DIM
EDGE_FEATURE_DIM = DGIN4_EDGE_FEATURE_DIM
@dataclass
class BasicModelConfig:
"""
Config for model1/2/3 run file.
... | 44.013453 | 169 | 0.669791 | from dataclasses import dataclass, field
from typing import List
import tensorflow as tf
from graph_networks.utilities import *
import logging
import os
ATOM_FEATURE_DIM = DGIN4_ATOM_FEATURE_DIM
EDGE_FEATURE_DIM = DGIN4_EDGE_FEATURE_DIM
@dataclass
class BasicModelConfig:
model_name: str = 'only_logs_dmpnn4_1'
... | true | true |
f72829ee3c90f92142527d7278c8a2015e22a7b6 | 561 | py | Python | exercises/es/test_01_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/test_01_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/test_01_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert "spacy.load" in __solution__, "¿Estás llamando a spacy.load?"
assert nlp.meta["lang"] == "es", "¿Estás cargando el modelo correcto?"
assert nlp.meta["name"] == "core_news_sm", "¿Estás cargando el modelo correcto?"
assert "nlp(text)" in __solution__, "¿Procesaste el texto correctamente... | 43.153846 | 99 | 0.673797 | def test():
assert "spacy.load" in __solution__, "¿Estás llamando a spacy.load?"
assert nlp.meta["lang"] == "es", "¿Estás cargando el modelo correcto?"
assert nlp.meta["name"] == "core_news_sm", "¿Estás cargando el modelo correcto?"
assert "nlp(text)" in __solution__, "¿Procesaste el texto correctamente... | true | true |
f7282a2f924b102e07ba4f411ea0993a9dbb6052 | 8,869 | py | Python | Code/sorting.py | siko408/CS-1.3-Core-Data-Structures | 4277c7c026b4aa38510f83f37c19b21ea64828a2 | [
"MIT"
] | null | null | null | Code/sorting.py | siko408/CS-1.3-Core-Data-Structures | 4277c7c026b4aa38510f83f37c19b21ea64828a2 | [
"MIT"
] | 4 | 2020-02-17T23:16:41.000Z | 2020-03-10T08:56:27.000Z | Code/sorting.py | siko408/CS-1.3-Core-Data-Structures | 4277c7c026b4aa38510f83f37c19b21ea64828a2 | [
"MIT"
] | null | null | null | #!python
from binarytree import *
def is_sorted(items):
"""Return a boolean indicating whether given items are in sorted order.
TODO: Running time: ??? Why and under what conditions?
TODO: Memory usage: ??? Why and under what conditions?"""
# TODO: Check that all adjacent items are in order, return ea... | 46.192708 | 79 | 0.685083 |
from binarytree import *
def is_sorted(items):
def bubble_sort(items):
def selection_sort(items):
def insertion_sort(items):
def merge(items1, items2):
def split_sort_merge(items):
def merge_sort(items):
# TODO: Split ite... | true | true |
f7282ab5b450a61c8b20960d685ccc0d070b6634 | 25,444 | py | Python | kuryr_kubernetes/controller/drivers/network_policy_security_groups.py | openshift-cherrypick-robot/kuryr-kubernetes | 8bb955ac520b5f7a15c97b5b97d53a2069befd99 | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/controller/drivers/network_policy_security_groups.py | openshift-cherrypick-robot/kuryr-kubernetes | 8bb955ac520b5f7a15c97b5b97d53a2069befd99 | [
"Apache-2.0"
] | null | null | null | kuryr_kubernetes/controller/drivers/network_policy_security_groups.py | openshift-cherrypick-robot/kuryr-kubernetes | 8bb955ac520b5f7a15c97b5b97d53a2069befd99 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 43.568493 | 79 | 0.583438 |
from kuryr_kubernetes import clients
from kuryr_kubernetes import config
from kuryr_kubernetes import constants
from kuryr_kubernetes.controller.drivers import base
from kuryr_kubernetes.controller.drivers import utils as driver_utils
from kuryr_kubernetes import exceptions
from oslo_config import cfg
f... | true | true |
f7282be0d76c30f36cb396659fd797b2a1a3d258 | 9,755 | py | Python | tools/r3det_gwd/train.py | Artcs1/RotationDetection | 095be17345ee9984d8de8f24eb6b5a0b2d764a06 | [
"Apache-2.0"
] | 850 | 2020-10-27T08:51:54.000Z | 2022-03-30T15:12:06.000Z | tools/r3det_gwd/train.py | Artcs1/RotationDetection | 095be17345ee9984d8de8f24eb6b5a0b2d764a06 | [
"Apache-2.0"
] | 94 | 2020-12-01T02:18:47.000Z | 2022-03-30T08:14:27.000Z | tools/r3det_gwd/train.py | Artcs1/RotationDetection | 095be17345ee9984d8de8f24eb6b5a0b2d764a06 | [
"Apache-2.0"
] | 149 | 2020-10-29T03:30:32.000Z | 2022-03-29T09:53:23.000Z | # -*- coding:utf-8 -*-
# Author: Xue Yang <yangxue-2019-sjtu@sjtu.edu.cn>
#
# License: Apache-2.0 license
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
... | 59.846626 | 122 | 0.445003 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
sys.path.append("../../")
from tools.train_base import Train
from libs.configs import cfgs
from libs.... | true | true |
f7282d249dac2d7f722b3793a7a371b8a033b7fe | 1,887 | py | Python | apps/win/sublime_text/sublime_text.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | 1 | 2020-11-13T18:02:12.000Z | 2020-11-13T18:02:12.000Z | apps/win/sublime_text/sublime_text.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | null | null | null | apps/win/sublime_text/sublime_text.py | PetrKryslUCSD/knausj_talon_pk | 6612adb1794e0b02ce8b1c2b478b74cd6858954b | [
"MIT"
] | null | null | null | from talon import Context, actions, Module
mod = Module()
ctx = Context()
# ctx.matches = r"""
# app.bundle: com.sublimetext.4
# """
# ctx.matches = r"""
# os: windows
# and app.name: Sublime Text
# """
ctx.matches = r"""
os: windows
and app.exe: sublime_text.exe
"""
@ctx.action_class("edit")
class edit_actions:
... | 22.464286 | 57 | 0.606253 | from talon import Context, actions, Module
mod = Module()
ctx = Context()
# app.bundle: com.sublimetext.4
# """
# os: windows
# and app.name: Sublime Text
# """
ctx.matches = r"""
os: windows
and app.exe: sublime_text.exe
"""
@ctx.action_class("edit")
class edit_actions:
def jump_line(n: int):
actions.key("ct... | true | true |
f7282d999fb518f8f29745365b3767f8f4dbc902 | 584 | py | Python | output/text.py | sait-berkeley-infosec/nessus-parser | 26348d3448d65eabc4b306b48262373df9bd2ac2 | [
"MIT"
] | null | null | null | output/text.py | sait-berkeley-infosec/nessus-parser | 26348d3448d65eabc4b306b48262373df9bd2ac2 | [
"MIT"
] | null | null | null | output/text.py | sait-berkeley-infosec/nessus-parser | 26348d3448d65eabc4b306b48262373df9bd2ac2 | [
"MIT"
] | null | null | null | def output(csv_data, environ, stats):
vulns = csv_data.vuln_to_hosts
sorted_vulns = sorted(vulns, key=csv_data.severity_to_key)
print
print csv_data.name
print "="*len(csv_data.name)
stats(csv_data)
for vuln in sorted_vulns:
print "~~~~~",
if environ['numeric_ids']:
... | 30.736842 | 62 | 0.577055 | def output(csv_data, environ, stats):
vulns = csv_data.vuln_to_hosts
sorted_vulns = sorted(vulns, key=csv_data.severity_to_key)
print
print csv_data.name
print "="*len(csv_data.name)
stats(csv_data)
for vuln in sorted_vulns:
print "~~~~~",
if environ['numeric_ids']:
... | false | true |
f7282dfc82b8b13ce2fcbc18c60d131314e16b61 | 27,440 | py | Python | openmdao/core/tests/test_connections.py | wright/OpenMDAO | 0996d562aa04ad864c44f91c60c0f33024e09d5f | [
"Apache-2.0"
] | null | null | null | openmdao/core/tests/test_connections.py | wright/OpenMDAO | 0996d562aa04ad864c44f91c60c0f33024e09d5f | [
"Apache-2.0"
] | 1 | 2018-06-18T15:09:10.000Z | 2018-06-18T15:09:10.000Z | openmdao/core/tests/test_connections.py | bbrelje/OpenMDAO | 58f9ff47197531f4fb4ef632c6bcca11e799ccf0 | [
"Apache-2.0"
] | 1 | 2021-04-15T13:33:39.000Z | 2021-04-15T13:33:39.000Z | """ Tests related to connecing inputs to outputs."""
import unittest
import numpy as np
from io import StringIO
import openmdao.api as om
from openmdao.utils.assert_utils import assert_near_equal, assert_warning
from openmdao.utils.mpi import MPI
try:
from openmdao.vectors.petsc_vector import PETScVector
except... | 37.081081 | 177 | 0.543477 |
import unittest
import numpy as np
from io import StringIO
import openmdao.api as om
from openmdao.utils.assert_utils import assert_near_equal, assert_warning
from openmdao.utils.mpi import MPI
try:
from openmdao.vectors.petsc_vector import PETScVector
except ImportError:
PETScVector = None
class TestConn... | true | true |
f7282e604acd8671472608a64329d71637642de8 | 4,853 | py | Python | goldminer/world.py | adael/goldminer | 47571c71c7f815eccb455a7d9e11d0e3892e9a5d | [
"MIT"
] | 2 | 2016-11-08T14:32:40.000Z | 2018-06-12T11:44:24.000Z | goldminer/world.py | adael/goldminer | 47571c71c7f815eccb455a7d9e11d0e3892e9a5d | [
"MIT"
] | null | null | null | goldminer/world.py | adael/goldminer | 47571c71c7f815eccb455a7d9e11d0e3892e9a5d | [
"MIT"
] | null | null | null | import random
from goldminer import settings, pgc, game, geom, texts, audio
from goldminer.camera import Camera
from goldminer.actor import Actor
from goldminer.worldmap import WorldMap
class World:
def __init__(self, world_map: WorldMap, player: Actor, seed):
self.world_map = world_map
self.actor... | 31.108974 | 105 | 0.585823 | import random
from goldminer import settings, pgc, game, geom, texts, audio
from goldminer.camera import Camera
from goldminer.actor import Actor
from goldminer.worldmap import WorldMap
class World:
def __init__(self, world_map: WorldMap, player: Actor, seed):
self.world_map = world_map
self.actor... | true | true |
f7282f631d271d7217711cbe9225772cf3c3323a | 2,540 | py | Python | setup.py | brianmwaters/vt-police-tools | 2619cec4fbf1a9fba4fbbfab7d5c14b83b6e6be0 | [
"CC0-1.0"
] | 1 | 2020-06-22T20:05:34.000Z | 2020-06-22T20:05:34.000Z | setup.py | brianmwaters/vt-police-tools | 2619cec4fbf1a9fba4fbbfab7d5c14b83b6e6be0 | [
"CC0-1.0"
] | null | null | null | setup.py | brianmwaters/vt-police-tools | 2619cec4fbf1a9fba4fbbfab7d5c14b83b6e6be0 | [
"CC0-1.0"
] | null | null | null | """Setup script."""
import glob
import importlib
import os
import setuptools
import vt_police_tools
def components(path):
"""Split a POSIX path into components."""
head, tail = os.path.split(os.path.normpath(path))
if head == "":
return [tail]
elif head == "/":
return [head + tail]
... | 27.021277 | 74 | 0.612992 |
import glob
import importlib
import os
import setuptools
import vt_police_tools
def components(path):
head, tail = os.path.split(os.path.normpath(path))
if head == "":
return [tail]
elif head == "/":
return [head + tail]
else:
return components(head) + [tail]
def strip_lead... | true | true |
f7282f8fe7c42b66565b59e947ca13c634d5ca89 | 12,583 | py | Python | extractViewAngle.py | sgascoin/extractViewAngle | 2ec54426714eac9628fa73b622519c88b8ab96b2 | [
"Apache-2.0"
] | null | null | null | extractViewAngle.py | sgascoin/extractViewAngle | 2ec54426714eac9628fa73b622519c88b8ab96b2 | [
"Apache-2.0"
] | 1 | 2020-05-08T22:51:08.000Z | 2020-05-08T22:51:08.000Z | extractViewAngle.py | sgascoin/extractViewAngle | 2ec54426714eac9628fa73b622519c88b8ab96b2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
extractViewAngle.py
Scope: export points or raster of viewing incidences angles from a Theia L2A product (rasters are scaled by 100 as UInt16)
Author: simon.gascoin@cesbio.cnes.fr
"""
import csv
import gdal
import numpy as np
import ogr
import os
import osr
import sys
import xml.etree.ElementTr... | 41.120915 | 123 | 0.590718 |
import csv
import gdal
import numpy as np
import ogr
import os
import osr
import sys
import xml.etree.ElementTree as ET
def readPoints(f):
with open(f,'r') as csvfile:
reader = csv.reader(csvfile,delimiter=',')
data = [r for r in reader]
return data
def writePoints(newPointsFn,outDi... | true | true |
f728309ee84e1f5907f5d1c8d6b8fbfbc11e9b8f | 1,275 | py | Python | backend/users/migrations/0002_auto_20210715_1151.py | crowdbotics-apps/dsfs-28863 | fea2672275927bd37d23e2267273e0eae54340d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/users/migrations/0002_auto_20210715_1151.py | crowdbotics-apps/dsfs-28863 | fea2672275927bd37d23e2267273e0eae54340d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/users/migrations/0002_auto_20210715_1151.py | crowdbotics-apps/dsfs-28863 | fea2672275927bd37d23e2267273e0eae54340d2 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | # Generated by Django 2.2.24 on 2021-07-15 11:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='last_updated',
... | 28.977273 | 75 | 0.560784 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='last_updated',
field=models.DateTimeField(auto_now=True, null=T... | true | true |
f728321268f92165324f6342c6c0d7554a2a65bb | 5,569 | py | Python | my_replay_buffer.py | yannikkellerde/TD3 | 6101baaa38a53bdaa34e33105f4e016eb84cf5a9 | [
"MIT"
] | null | null | null | my_replay_buffer.py | yannikkellerde/TD3 | 6101baaa38a53bdaa34e33105f4e016eb84cf5a9 | [
"MIT"
] | null | null | null | my_replay_buffer.py | yannikkellerde/TD3 | 6101baaa38a53bdaa34e33105f4e016eb84cf5a9 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import pickle
import os
class ReplayBuffer_particles(object):
def __init__(self, obs_space, action_space, max_size=int(1e6), load_folder=None):
self.max_size = max_size
self.store_np = ["state_features","state_particles","action",
"next_state... | 41.87218 | 85 | 0.604597 | import numpy as np
import torch
import pickle
import os
class ReplayBuffer_particles(object):
def __init__(self, obs_space, action_space, max_size=int(1e6), load_folder=None):
self.max_size = max_size
self.store_np = ["state_features","state_particles","action",
"next_state... | true | true |
f72832377fdf7269cdd940f641f5e93da1048678 | 47,946 | py | Python | locust/stats.py | DDSystemLab/ddsl_locust | e98455592a2e8c6722f1ba1fd3700fcf69a8744a | [
"MIT"
] | null | null | null | locust/stats.py | DDSystemLab/ddsl_locust | e98455592a2e8c6722f1ba1fd3700fcf69a8744a | [
"MIT"
] | 1 | 2021-01-16T17:56:48.000Z | 2021-01-16T17:56:48.000Z | locust/stats.py | DDSystemLab/ddsl_locust | e98455592a2e8c6722f1ba1fd3700fcf69a8744a | [
"MIT"
] | 1 | 2019-10-18T20:36:13.000Z | 2019-10-18T20:36:13.000Z | import datetime
import hashlib
import time
from collections import namedtuple, OrderedDict
from copy import copy
from itertools import chain
import csv
import gevent
from .exception import StopUser, CatchResponseError
import logging
console_logger = logging.getLogger("locust.stats_logger")
STATS_NAME_WIDTH = 60
ST... | 38.822672 | 160 | 0.643119 | import datetime
import hashlib
import time
from collections import namedtuple, OrderedDict
from copy import copy
from itertools import chain
import csv
import gevent
from .exception import StopUser, CatchResponseError
import logging
console_logger = logging.getLogger("locust.stats_logger")
STATS_NAME_WIDTH = 60
ST... | true | true |
f7283271316cefc390f77373b1c822358d1536f2 | 24,260 | py | Python | src/c4/cmany/build.py | biojppm/cmany | b20c24169d60077122ae29a0c09526913340fd5c | [
"MIT"
] | 20 | 2017-05-17T18:43:08.000Z | 2021-02-13T16:20:53.000Z | src/c4/cmany/build.py | biojppm/cmany | b20c24169d60077122ae29a0c09526913340fd5c | [
"MIT"
] | 8 | 2017-06-04T17:01:06.000Z | 2022-03-17T12:43:32.000Z | src/c4/cmany/build.py | biojppm/cmany | b20c24169d60077122ae29a0c09526913340fd5c | [
"MIT"
] | 1 | 2017-06-04T13:09:19.000Z | 2017-06-04T13:09:19.000Z | import os
import copy
import re
import dill
import subprocess
from datetime import datetime
from collections import OrderedDict as odict
from .generator import Generator
from . import util, cmake, vsinfo
from .named_item import NamedItem
from .variant import Variant
from .build_flags import BuildFlags
from .compiler i... | 38.94061 | 159 | 0.571805 | import os
import copy
import re
import dill
import subprocess
from datetime import datetime
from collections import OrderedDict as odict
from .generator import Generator
from . import util, cmake, vsinfo
from .named_item import NamedItem
from .variant import Variant
from .build_flags import BuildFlags
from .compiler i... | true | true |
f72832b743dddc38a07d02e41bb07d0fda8ea72c | 3,919 | py | Python | canu/utils/inventory.py | Cray-HPE/canu | 3a92ce1e9b63f35aa30b9135afaa734e61909407 | [
"MIT"
] | 6 | 2021-09-16T22:02:48.000Z | 2022-02-04T18:08:57.000Z | canu/utils/inventory.py | Cray-HPE/canu | 3a92ce1e9b63f35aa30b9135afaa734e61909407 | [
"MIT"
] | 57 | 2021-09-17T17:15:59.000Z | 2022-03-31T20:56:21.000Z | canu/utils/inventory.py | Cray-HPE/canu | 3a92ce1e9b63f35aa30b9135afaa734e61909407 | [
"MIT"
] | 4 | 2022-01-06T17:09:02.000Z | 2022-02-04T18:09:33.000Z | # MIT License
#
# (C) Copyright [2022] Hewlett Packard Enterprise Development LP
#
# 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 righ... | 40.822917 | 76 | 0.56494 |
import json
import click
from canu.utils.sls import pull_sls_hardware, pull_sls_networks
def inventory(username, password, network, sls_json=None):
inventory = {"groups": "shasta", "hosts": {}}
if sls_json:
try:
input_json = json.load(sls_json)
except (json.J... | true | true |
f72832e0efafdb5da91882119166814ebcaf4039 | 207 | py | Python | output/models/ms_data/datatypes/facets/negative_integer/negative_integer_total_digits003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/datatypes/facets/negative_integer/negative_integer_total_digits003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/datatypes/facets/negative_integer/negative_integer_total_digits003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.datatypes.facets.negative_integer.negative_integer_total_digits003_xsd.negative_integer_total_digits003 import (
FooType,
Test,
)
__all__ = [
"FooType",
"Test",
]
| 20.7 | 139 | 0.758454 | from output.models.ms_data.datatypes.facets.negative_integer.negative_integer_total_digits003_xsd.negative_integer_total_digits003 import (
FooType,
Test,
)
__all__ = [
"FooType",
"Test",
]
| true | true |
f72833ccdad8202a2c57ba9edaf8b81c8c0faafa | 693 | py | Python | networkit/test/test_independentset.py | krzysztof-turowski/networkit | b0db9e30be1a7f7dcf74eaff2a013988a81973ce | [
"MIT"
] | 194 | 2016-10-21T22:56:49.000Z | 2019-06-21T03:04:22.000Z | networkit/test/test_independentset.py | krzysztof-turowski/networkit | b0db9e30be1a7f7dcf74eaff2a013988a81973ce | [
"MIT"
] | 215 | 2017-02-06T09:12:54.000Z | 2019-06-24T10:52:24.000Z | networkit/test/test_independentset.py | krzysztof-turowski/networkit | b0db9e30be1a7f7dcf74eaff2a013988a81973ce | [
"MIT"
] | 93 | 2017-01-10T10:51:01.000Z | 2019-06-20T13:58:57.000Z | #!/usr/bin/env python3
import unittest
import networkit as nk
class TestGraphTools(unittest.TestCase):
def testLubyAlgorithm(self):
G = nk.Graph(4, False, False)
G.addEdge(0, 1)
G.addEdge(0, 2)
G.addEdge(1, 2)
G.addEdge(2, 3)
luby = nk.independentset.Luby()
res = luby.run(G)
count = sum(res)
# The ... | 23.896552 | 83 | 0.698413 |
import unittest
import networkit as nk
class TestGraphTools(unittest.TestCase):
def testLubyAlgorithm(self):
G = nk.Graph(4, False, False)
G.addEdge(0, 1)
G.addEdge(0, 2)
G.addEdge(1, 2)
G.addEdge(2, 3)
luby = nk.independentset.Luby()
res = luby.run(G)
count = sum(res)
self.assertGreaterEqual(c... | true | true |
f72833dd50109fe208c3cdeb6c934bc3c7e0fd11 | 753 | py | Python | TTS.py | mahmoud-x923/TTS-STT-python | c225deedbbb5b3ded9be02f2edf39765a67dfe27 | [
"Apache-2.0"
] | null | null | null | TTS.py | mahmoud-x923/TTS-STT-python | c225deedbbb5b3ded9be02f2edf39765a67dfe27 | [
"Apache-2.0"
] | null | null | null | TTS.py | mahmoud-x923/TTS-STT-python | c225deedbbb5b3ded9be02f2edf39765a67dfe27 | [
"Apache-2.0"
] | null | null | null | from ibm_watson import TextToSpeechV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
def main(text,audio):
authenticator = IAMAuthenticator('7-KyTRyrBXQSuRQO7wazH5Q-Q_5QzDs6R0qOZqD1hyu6')
text_to_speech = TextToSpeechV1(
authenticator=authenticator
)
text_to_speech.set_s... | 44.294118 | 129 | 0.73838 | from ibm_watson import TextToSpeechV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
def main(text,audio):
authenticator = IAMAuthenticator('7-KyTRyrBXQSuRQO7wazH5Q-Q_5QzDs6R0qOZqD1hyu6')
text_to_speech = TextToSpeechV1(
authenticator=authenticator
)
text_to_speech.set_s... | true | true |
f72834f75e285301d289bba68e29608e0903c060 | 743 | py | Python | src/Javinizer/translate_deepl.py | Toastyice/Javinizer | 017b3aa84a9017c4b38f3b2938a4e20340219d68 | [
"MIT"
] | 340 | 2019-12-03T08:38:45.000Z | 2022-03-30T18:01:22.000Z | src/Javinizer/translate_deepl.py | Toastyice/Javinizer | 017b3aa84a9017c4b38f3b2938a4e20340219d68 | [
"MIT"
] | 227 | 2019-12-25T07:44:53.000Z | 2022-03-24T08:53:29.000Z | src/Javinizer/translate_deepl.py | Toastyice/Javinizer | 017b3aa84a9017c4b38f3b2938a4e20340219d68 | [
"MIT"
] | 65 | 2019-12-21T18:22:35.000Z | 2022-03-25T01:48:58.000Z | import sys
import requests
import tempfile
import os
import json
#Select Url based on key provided (free keys always end in :fx)
baseurl = "https://api-free.deepl.com/v2/translate" if sys.argv[3].endswith(":fx") else "https://api.deepl.com/v2/translate"
url = "{}?auth_key={}&text={}&target_lang={}".format(baseurl, sy... | 30.958333 | 124 | 0.732167 | import sys
import requests
import tempfile
import os
import json
baseurl = "https://api-free.deepl.com/v2/translate" if sys.argv[3].endswith(":fx") else "https://api.deepl.com/v2/translate"
url = "{}?auth_key={}&text={}&target_lang={}".format(baseurl, sys.argv[3], sys.argv[1], sys.argv[2])
r = requests.get(url)
j = ... | true | true |
f72835d20f5516cdcbaab205140d2862cc287eae | 2,246 | py | Python | userbot/modules/shortlink.py | kuinginngopi/Rpan-Userbot | 2e9bbd98a242e82e4c44e95c15c6669df81934b9 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/shortlink.py | kuinginngopi/Rpan-Userbot | 2e9bbd98a242e82e4c44e95c15c6669df81934b9 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/shortlink.py | kuinginngopi/Rpan-Userbot | 2e9bbd98a242e82e4c44e95c15c6669df81934b9 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | from asyncio.exceptions import TimeoutError
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.contacts import UnblockRequest
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP
from userbot.utils import edit_or_reply, man_cmd
@man_cmd(pattern="short(?: |$)(.*)")... | 36.225806 | 98 | 0.609083 | from asyncio.exceptions import TimeoutError
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.contacts import UnblockRequest
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP
from userbot.utils import edit_or_reply, man_cmd
@man_cmd(pattern="short(?: |$)(.*)")... | true | true |
f728362a23cfcc135a81ab7ad984b23e49570023 | 458 | py | Python | sermepa/admin.py | Etxea/django-sermepa | 1be9173c4786e138b4dafce830f6d8e22a6762e6 | [
"MIT"
] | 3 | 2015-12-15T09:49:36.000Z | 2018-06-28T10:29:00.000Z | sermepa/admin.py | Etxea/django-sermepa | 1be9173c4786e138b4dafce830f6d8e22a6762e6 | [
"MIT"
] | null | null | null | sermepa/admin.py | Etxea/django-sermepa | 1be9173c4786e138b4dafce830f6d8e22a6762e6 | [
"MIT"
] | 4 | 2015-12-15T09:49:40.000Z | 2021-09-10T10:07:02.000Z | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import SermepaResponse, SermepaIdTPV
class SermepaResponseAdmin(admin.ModelAdmin):
search_fields = ['Ds_Order']
list_display = ('creation_date', 'Ds_Order', 'Ds_Amount',
'Ds_Response', 'Ds_TransactionType', 'check_signat... | 32.714286 | 75 | 0.727074 |
from django.contrib import admin
from .models import SermepaResponse, SermepaIdTPV
class SermepaResponseAdmin(admin.ModelAdmin):
search_fields = ['Ds_Order']
list_display = ('creation_date', 'Ds_Order', 'Ds_Amount',
'Ds_Response', 'Ds_TransactionType', 'check_signature')
list_filter =... | true | true |
f7283677a1370620e01303326e72b7c4aee83574 | 12,213 | py | Python | examples/trials/cifar10_grad_match/cords/selectionstrategies/supervisedlearning/submodularselectionstrategy.py | savan77/nni | 510213393d9cae58c5a8cccd21f322f7bba4e0cf | [
"MIT"
] | null | null | null | examples/trials/cifar10_grad_match/cords/selectionstrategies/supervisedlearning/submodularselectionstrategy.py | savan77/nni | 510213393d9cae58c5a8cccd21f322f7bba4e0cf | [
"MIT"
] | null | null | null | examples/trials/cifar10_grad_match/cords/selectionstrategies/supervisedlearning/submodularselectionstrategy.py | savan77/nni | 510213393d9cae58c5a8cccd21f322f7bba4e0cf | [
"MIT"
] | null | null | null | import apricot
import numpy as np
import torch
import torch.nn.functional as F
from scipy.sparse import csr_matrix
from .dataselectionstrategy import DataSelectionStrategy
from torch.utils.data.sampler import SubsetRandomSampler
class SubmodularSelectionStrategy(DataSelectionStrategy):
"""
This class extends ... | 42.554007 | 125 | 0.540326 | import apricot
import numpy as np
import torch
import torch.nn.functional as F
from scipy.sparse import csr_matrix
from .dataselectionstrategy import DataSelectionStrategy
from torch.utils.data.sampler import SubsetRandomSampler
class SubmodularSelectionStrategy(DataSelectionStrategy):
def __init__(self, trainlo... | true | true |
f72837d3e6a151d44880e1c180f038707d36feb6 | 3,110 | py | Python | data/p2DJ/New/R2/benchmark/startQiskit_Class124.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/R2/benchmark/startQiskit_Class124.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/R2/benchmark/startQiskit_Class124.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=9
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as... | 28.272727 | 80 | 0.619936 |
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def b... | true | true |
f7283818fe3ff5c8ba8e1316cf68b465d6417b2f | 1,900 | py | Python | google/cloud/resourcemanager/v3/resourcemanager-v3-py/setup.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/resourcemanager/v3/resourcemanager-v3-py/setup.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/resourcemanager/v3/resourcemanager-v3-py/setup.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... | 34.545455 | 84 | 0.662105 |
import io
import os
import setuptools
version = '0.1.0'
package_root = os.path.abspath(os.path.dirname(__file__))
readme_filename = os.path.join(package_root, 'README.rst')
with io.open(readme_filename, encoding='utf-8') as readme_file:
readme = readme_file.read()
setuptools.setup(
name='go... | true | true |
f728382502116d54ffa9b7e1ccbe2024ad4effea | 85,815 | py | Python | jax/interpreters/pxla.py | cloudhan/jax | 9781f365a1c5dbdf57bf78b98831c4390eb9ca5f | [
"Apache-2.0"
] | null | null | null | jax/interpreters/pxla.py | cloudhan/jax | 9781f365a1c5dbdf57bf78b98831c4390eb9ca5f | [
"Apache-2.0"
] | 6 | 2021-11-25T07:58:40.000Z | 2022-01-31T21:15:49.000Z | jax/interpreters/pxla.py | cloudhan/jax | 9781f365a1c5dbdf57bf78b98831c4390eb9ca5f | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 41.376567 | 120 | 0.709911 |
from contextlib import contextmanager
from collections import defaultdict, OrderedDict
import dataclasses
from functools import partial
import itertools as it
import operator as op
import threading
from typing import (Any, Callable, Dict, List, NamedTuple, Optional,
Sequ... | true | true |
f72838bf20112d8e79c4ac5d0568dc33060c0ae6 | 1,960 | py | Python | assembler.py | martimfj/VBA-Compiler | c5a88843a0d13d561f4baba312bbaf7f8a2e5ca0 | [
"MIT"
] | null | null | null | assembler.py | martimfj/VBA-Compiler | c5a88843a0d13d561f4baba312bbaf7f8a2e5ca0 | [
"MIT"
] | 9 | 2019-02-23T13:19:30.000Z | 2019-06-08T14:34:23.000Z | assembler.py | martimfj/VBA-Compiler | c5a88843a0d13d561f4baba312bbaf7f8a2e5ca0 | [
"MIT"
] | null | null | null | CONSTANTS = [
"SYS_EXIT equ 1",
"SYS_READ equ 3",
"SYS_WRITE equ 4",
"STDIN equ 0",
"STDOUT equ 1",
"True equ 1",
"False equ 0"
]
DATA_SEG = [
"segment .data"
]
BSS_SEG = [
"segment .bss",
" res RESB 1"
]
TEXT_SEG =[
"section .text",
" global _start"
]
PRINT_SUBROUTINE = [
"print:",
" PUSH EBP",
" MOV EBP, ... | 16.896552 | 128 | 0.554082 | CONSTANTS = [
"SYS_EXIT equ 1",
"SYS_READ equ 3",
"SYS_WRITE equ 4",
"STDIN equ 0",
"STDOUT equ 1",
"True equ 1",
"False equ 0"
]
DATA_SEG = [
"segment .data"
]
BSS_SEG = [
"segment .bss",
" res RESB 1"
]
TEXT_SEG =[
"section .text",
" global _start"
]
PRINT_SUBROUTINE = [
"print:",
" PUSH EBP",
" MOV EBP, ... | true | true |
f7283953cc559dbedfe2237debe920767512e3e6 | 1,115 | py | Python | share/rpcuser/rpcuser.py | DTL-UWM/SOISCOIN | dd9553a5f79fab4a044eaae1423426346d9c4a53 | [
"MIT"
] | null | null | null | share/rpcuser/rpcuser.py | DTL-UWM/SOISCOIN | dd9553a5f79fab4a044eaae1423426346d9c4a53 | [
"MIT"
] | null | null | null | share/rpcuser/rpcuser.py | DTL-UWM/SOISCOIN | dd9553a5f79fab4a044eaae1423426346d9c4a53 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(s... | 26.547619 | 79 | 0.728251 |
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(sys.argv) < 2:
sys.stderr.write('Please include username as an argument.\n')
sys.exit(0)
username = sys.argv[1]
cryptogen = SystemRandom()
salt_sequence = [cryptogen.randrange(256) for i in range(16)]... | true | true |
f72839a973138a4955ecdaae9704a9b1a0d96162 | 6,700 | py | Python | mne/time_frequency/_stft.py | enricovara/mne-python | f6f2aa7a97c3ae7ae5276202805d2f45de7b64cc | [
"BSD-3-Clause"
] | 1 | 2021-03-13T04:41:45.000Z | 2021-03-13T04:41:45.000Z | mne/time_frequency/_stft.py | enricovara/mne-python | f6f2aa7a97c3ae7ae5276202805d2f45de7b64cc | [
"BSD-3-Clause"
] | 1 | 2021-01-29T19:35:06.000Z | 2021-01-29T19:35:06.000Z | mne/time_frequency/_stft.py | enricovara/mne-python | f6f2aa7a97c3ae7ae5276202805d2f45de7b64cc | [
"BSD-3-Clause"
] | null | null | null | from math import ceil
import numpy as np
from ..fixes import rfft, irfft, rfftfreq
from ..utils import logger, verbose
@verbose
def stft(x, wsize, tstep=None, verbose=None):
"""STFT Short-Term Fourier Transform using a sine window.
The transformation is designed to be a tight frame that can be
perfectly... | 27.125506 | 78 | 0.568209 | from math import ceil
import numpy as np
from ..fixes import rfft, irfft, rfftfreq
from ..utils import logger, verbose
@verbose
def stft(x, wsize, tstep=None, verbose=None):
if not np.isrealobj(x):
raise ValueError("x is not a real valued array")
if x.ndim == 1:
x = x[None, :]
n_signals... | true | true |
f72839c01680fa5e8dca84f89e02ed7c86a3f02b | 6,728 | py | Python | hw4/p2_Parsons_Ross.py | rp779/Python-COP-4045 | 2feabafef4a3ee04d593a35aa77f45b5d25d3754 | [
"MIT"
] | null | null | null | hw4/p2_Parsons_Ross.py | rp779/Python-COP-4045 | 2feabafef4a3ee04d593a35aa77f45b5d25d3754 | [
"MIT"
] | null | null | null | hw4/p2_Parsons_Ross.py | rp779/Python-COP-4045 | 2feabafef4a3ee04d593a35aa77f45b5d25d3754 | [
"MIT"
] | null | null | null | # Problem 2
# @author: Ross
import sys # sys.exit()
import testif # testif module
import turtle # Part A
def draw_leaf_straight(length, level):
"""PART A: The draw_leaf_straight() function takes two arguments (length and level) and returns a graphic that depicts a leaf drawn in turtle graphics. """
if ... | 50.969697 | 410 | 0.609394 |
import sys
import testif
import turtle
def draw_leaf_straight(length, level):
if level <= 0:
return
else:
turtle.forward(length)
draw_leaf_straight(0.6*length, level-1)
turtle.left(45)
draw_leaf_straight(0.6*length, level-1)
turtle.right(90)
... | true | true |
f7283b2b432fc5e9e9ae4ff0badca1280da5923a | 9,648 | py | Python | tests/instantiate/__init__.py | sara-nl/hydra | 8fd0d23d71cf528528ca5eda26e0c1f0c1e973d7 | [
"MIT"
] | null | null | null | tests/instantiate/__init__.py | sara-nl/hydra | 8fd0d23d71cf528528ca5eda26e0c1f0c1e973d7 | [
"MIT"
] | null | null | null | tests/instantiate/__init__.py | sara-nl/hydra | 8fd0d23d71cf528528ca5eda26e0c1f0c1e973d7 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import collections
import collections.abc
from dataclasses import dataclass
from functools import partial
from typing import Any, Dict, List, NoReturn, Optional, Tuple
from omegaconf import MISSING, DictConfig, ListConfig
from hydra.types import T... | 22.542056 | 86 | 0.630493 |
import collections
import collections.abc
from dataclasses import dataclass
from functools import partial
from typing import Any, Dict, List, NoReturn, Optional, Tuple
from omegaconf import MISSING, DictConfig, ListConfig
from hydra.types import TargetConf
from tests.instantiate.module_shadowed_by_function import a_... | true | true |
f7283bdb2ea008a0af45944cac9adf39b2d9a8cf | 2,791 | py | Python | src/third_party/beaengine/tests/0f3a67.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | 1 | 2022-01-17T17:40:29.000Z | 2022-01-17T17:40:29.000Z | src/third_party/beaengine/tests/0f3a67.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | null | null | null | src/third_party/beaengine/tests/0f3a67.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | 40.449275 | 85 | 0.660337 |
from headers.BeaEnginePython import *
from nose.tools import *
class TestSuite:
def test(self):
myEVEX = EVEX('EVEX.256.66.0F3A.W0')
Buffer = bytes.fromhex('{}672011'.format(myEVEX.prefix()))
myDisasm = Disasm(Buffer)
myDisasm.read()
as... | true | true |
f7283da9211db669f163190590b7288c219db82f | 28,506 | py | Python | xarray_sentinel/sentinel1.py | scottyhq/xarray-sentinel | 3899a86e5bf5d56454e7467d9231bc97ebab8fe1 | [
"Apache-2.0"
] | null | null | null | xarray_sentinel/sentinel1.py | scottyhq/xarray-sentinel | 3899a86e5bf5d56454e7467d9231bc97ebab8fe1 | [
"Apache-2.0"
] | null | null | null | xarray_sentinel/sentinel1.py | scottyhq/xarray-sentinel | 3899a86e5bf5d56454e7467d9231bc97ebab8fe1 | [
"Apache-2.0"
] | null | null | null | """Map Sentinel-1 data products to xarray.
References:
- Sentinel-1 document library: https://sentinels.copernicus.eu/web/sentinel/user-guides/sentinel-1-sar/document-library
- Sentinel-1 Product Specification v3.9 07 May 2021 S1-RS-MDA-52-7441-3-9 documenting IPF 3.40
https://sentinel.esa.int/documents/247904... | 37.311518 | 121 | 0.646881 |
import contextlib
import os
import typing as T
import warnings
import fsspec
import numpy as np
import pandas as pd
import xarray as xr
from . import conventions, esa_safe
SPEED_OF_LIGHT = 299_792_458
ONE_SECOND = np.timedelta64(1, "s")
def get_fs_path(
urlpath_or_path: esa_safe.PathType,
fs: T.Optional... | true | true |
f7283fda3f312bf5acbd51f353aeab26d065e142 | 640 | py | Python | utils.py | philshem/py-youtube-dl-email | cc358e649e86ecdd1b1b5c36fd55f8709a14a4c2 | [
"MIT"
] | null | null | null | utils.py | philshem/py-youtube-dl-email | cc358e649e86ecdd1b1b5c36fd55f8709a14a4c2 | [
"MIT"
] | null | null | null | utils.py | philshem/py-youtube-dl-email | cc358e649e86ecdd1b1b5c36fd55f8709a14a4c2 | [
"MIT"
] | null | null | null | import os
from dotenv import load_dotenv
# https://murhabazi.com/read-emails-python/
def read_credentails():
"""
Return user’s credentials from the environment variables file and
raise a an exception if the credentials are not present
Raises:
NotImplementedError: [description]
"""
load_dotenv()
USER_EMA... | 27.826087 | 109 | 0.764063 | import os
from dotenv import load_dotenv
def read_credentails():
load_dotenv()
USER_EMAIL = os.getenv("USER_EMAIL")
USER_PASSWORD = os.getenv("USER_PASSWORD")
USER_IMAP = os.getenv("USER_IMAP")
if USER_IMAP and USER_EMAIL and USER_PASSWORD:
return USER_IMAP, USER_EMAIL, USER_PASSWORD
else:
raise ValueErr... | true | true |
f7284242f4393ec12e6b2c8a2971cf419d7bdb4c | 479 | py | Python | jp.atcoder/abc201/abc201_c/25914704.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc201/abc201_c/25914704.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc201/abc201_c/25914704.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import itertools
import typing
def solve(s: str) -> typing.NoReturn:
n = 10
cand = []
must = 0
for i in range(n):
if s[i] == 'o':
cand.append(i)
must |= 1 << i
if s[i] == '?':
cand.append(i)
cnt = 0
for prod in itertools.product(cand, repeat=4):
res = 0
... | 14.515152 | 49 | 0.478079 | import itertools
import typing
def solve(s: str) -> typing.NoReturn:
n = 10
cand = []
must = 0
for i in range(n):
if s[i] == 'o':
cand.append(i)
must |= 1 << i
if s[i] == '?':
cand.append(i)
cnt = 0
for prod in itertools.product(cand, repeat=4):
res = 0
... | true | true |
f72843936c76a8e2157fea40a8e78716b137635c | 290 | py | Python | examples/example.py | gitcheol/selective_search | 896d849320a8b197210a2e15c56ed4c93a3e1fd8 | [
"MIT"
] | 34 | 2019-10-06T18:47:22.000Z | 2022-03-24T19:22:53.000Z | examples/example.py | gitcheol/selective_search | 896d849320a8b197210a2e15c56ed4c93a3e1fd8 | [
"MIT"
] | 5 | 2020-05-10T06:55:49.000Z | 2022-02-09T02:15:50.000Z | examples/example.py | gitcheol/selective_search | 896d849320a8b197210a2e15c56ed4c93a3e1fd8 | [
"MIT"
] | 15 | 2020-02-03T06:05:15.000Z | 2022-02-08T11:14:07.000Z | import skimage
import selective_search
image = skimage.data.astronaut()
# Propose boxes
boxes = selective_search.selective_search(image, mode='single', random_sort=True)
# Filter box proposals
boxes_filter = selective_search.box_filter(boxes, min_size=20, topN=80)
print(boxes_filter)
| 20.714286 | 81 | 0.803448 | import skimage
import selective_search
image = skimage.data.astronaut()
boxes = selective_search.selective_search(image, mode='single', random_sort=True)
boxes_filter = selective_search.box_filter(boxes, min_size=20, topN=80)
print(boxes_filter)
| true | true |
f728440ef281188f102539237d437dea70ef31b8 | 2,515 | py | Python | framework/Agent.py | citang/Python-Web-Framework | 6c27a1ad656ac59ba25467fbe4800fb3745bcfa6 | [
"Apache-2.0"
] | null | null | null | framework/Agent.py | citang/Python-Web-Framework | 6c27a1ad656ac59ba25467fbe4800fb3745bcfa6 | [
"Apache-2.0"
] | null | null | null | framework/Agent.py | citang/Python-Web-Framework | 6c27a1ad656ac59ba25467fbe4800fb3745bcfa6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@FileName : Agent.py
@Author : citang
@Date : 2021/7/27 5:46 下午
@Description : description the function of the file
"""
import sys
from framework import Model, Db, Log, Config, Common
class __Agent__:
"""模块功能"""
def __init__(self,... | 23.726415 | 83 | 0.560636 |
import sys
from framework import Model, Db, Log, Config, Common
class __Agent__:
def __init__(self, resultype, mod, handler, ip):
self.__DATA = None
self.__RESULTYPE = resultype
self.__APICODE = 200
self.__MODULENAME = mod
self.__HANDLERNAME = handler
self.__R... | true | true |
f72844b0c4c7443bd26d04746672badc813614df | 1,070 | py | Python | wrappers/python/tests/gateway/test_get_scratchpad_status.py | vvalkonen/backend-apis | 769a45e6a90a87ab5af78e9a50ebde12f4821b99 | [
"Apache-2.0"
] | 9 | 2019-12-20T06:41:37.000Z | 2020-09-21T03:34:47.000Z | wrappers/python/tests/gateway/test_get_scratchpad_status.py | vvalkonen/backend-apis | 769a45e6a90a87ab5af78e9a50ebde12f4821b99 | [
"Apache-2.0"
] | 38 | 2019-05-09T09:55:01.000Z | 2022-01-04T10:52:46.000Z | wrappers/python/tests/gateway/test_get_scratchpad_status.py | vvalkonen/backend-apis | 769a45e6a90a87ab5af78e9a50ebde12f4821b99 | [
"Apache-2.0"
] | 13 | 2019-10-29T19:51:08.000Z | 2021-11-25T15:08:02.000Z | # flake8: noqa
import wirepas_messaging
from default_value import *
def test_generate_parse_request():
# Clear a scratchpad
request = wirepas_messaging.gateway.api.GetScratchpadStatusRequest(
SINK_ID, REQUEST_ID
)
request2 = wirepas_messaging.gateway.api.GetScratchpadStatusRequest.from_paylo... | 24.883721 | 86 | 0.671028 |
import wirepas_messaging
from default_value import *
def test_generate_parse_request():
request = wirepas_messaging.gateway.api.GetScratchpadStatusRequest(
SINK_ID, REQUEST_ID
)
request2 = wirepas_messaging.gateway.api.GetScratchpadStatusRequest.from_payload(
request.payload
)
... | true | true |
f7284521646ce37856371178fae34fe4c113ed42 | 827 | py | Python | coverage.py | Adilet1/beta_career | 6c484bc06852b587bd4dadee27220e4aa41700c2 | [
"MIT"
] | null | null | null | coverage.py | Adilet1/beta_career | 6c484bc06852b587bd4dadee27220e4aa41700c2 | [
"MIT"
] | null | null | null | coverage.py | Adilet1/beta_career | 6c484bc06852b587bd4dadee27220e4aa41700c2 | [
"MIT"
] | null | null | null | import os
import subprocess
def run_test_coverage():
"""
Simple run coverage and do:
- Runs the tests
- Check your test coverage
- Generates HTML coverage report under "htmlcov" directory.
"""
py_test_command = "coverage run -m pytest"
CURRENT_DIR = os.path.dirname(os.path.abspath(... | 25.84375 | 87 | 0.674728 | import os
import subprocess
def run_test_coverage():
py_test_command = "coverage run -m pytest"
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
try:
subprocess.run(py_test_command.split())
coverage_dir = os.path.join(CURRENT_DIR, "htmlcov")
os.chdir(coverage_dir)
exce... | true | true |
f72845befa374d03fd40de9ef5623b59ba01c745 | 3,238 | py | Python | downloader.py | ogenesYi/YNOTE_HELPER | d95ab22514a62d136ad32f612a88369ffc4c36f6 | [
"MIT"
] | 1 | 2022-03-16T12:46:54.000Z | 2022-03-16T12:46:54.000Z | downloader.py | ogenesYi/YNOTE_HELPER | d95ab22514a62d136ad32f612a88369ffc4c36f6 | [
"MIT"
] | 1 | 2022-03-29T05:51:49.000Z | 2022-03-29T05:51:49.000Z | downloader.py | ogenes/YNOTE_HELPER | d95ab22514a62d136ad32f612a88369ffc4c36f6 | [
"MIT"
] | 1 | 2022-02-17T13:56:14.000Z | 2022-02-17T13:56:14.000Z | import json
import os
import requests
def config():
with open(os.path.dirname(os.path.abspath(__file__)) + "/config.json") as config_file:
data = config_file.read()
return json.loads(data)
def request(api):
ynote_sess = config().get('YNOTE_SESS', '')
ynote_login = config().get('YNOTE_LOGIN',... | 30.261682 | 96 | 0.556516 | import json
import os
import requests
def config():
with open(os.path.dirname(os.path.abspath(__file__)) + "/config.json") as config_file:
data = config_file.read()
return json.loads(data)
def request(api):
ynote_sess = config().get('YNOTE_SESS', '')
ynote_login = config().get('YNOTE_LOGIN',... | true | true |
f72847d7c434145ce28957ed9f6f7e61c72ff185 | 20,788 | bzl | Python | third_party/repositories/scala_2_11.bzl | urianchang/rules_scala | 70a97425774a59a282853922136f7403ad9c8069 | [
"Apache-2.0"
] | null | null | null | third_party/repositories/scala_2_11.bzl | urianchang/rules_scala | 70a97425774a59a282853922136f7403ad9c8069 | [
"Apache-2.0"
] | null | null | null | third_party/repositories/scala_2_11.bzl | urianchang/rules_scala | 70a97425774a59a282853922136f7403ad9c8069 | [
"Apache-2.0"
] | null | null | null | artifacts = {
"io_bazel_rules_scala_scala_library": {
"artifact": "org.scala-lang:scala-library:2.11.12",
"sha256": "0b3d6fd42958ee98715ba2ec5fe221f4ca1e694d7c981b0ae0cd68e97baf6dce",
},
"io_bazel_rules_scala_scala_compiler": {
"artifact": "org.scala-lang:scala-compiler:2.11.12",
... | 44.229787 | 85 | 0.682894 | artifacts = {
"io_bazel_rules_scala_scala_library": {
"artifact": "org.scala-lang:scala-library:2.11.12",
"sha256": "0b3d6fd42958ee98715ba2ec5fe221f4ca1e694d7c981b0ae0cd68e97baf6dce",
},
"io_bazel_rules_scala_scala_compiler": {
"artifact": "org.scala-lang:scala-compiler:2.11.12",
... | true | true |
f728494cc3ef6bb334cd5035b7f7227ccaee9864 | 1,098 | py | Python | tests/__init__.py | orest-d/libhxl-python | fd4523bdef7c0c0333bd0b287d7eed70e18e48e1 | [
"Unlicense"
] | null | null | null | tests/__init__.py | orest-d/libhxl-python | fd4523bdef7c0c0333bd0b287d7eed70e18e48e1 | [
"Unlicense"
] | null | null | null | tests/__init__.py | orest-d/libhxl-python | fd4523bdef7c0c0333bd0b287d7eed70e18e48e1 | [
"Unlicense"
] | null | null | null | import logging
import os
import re
import unittest.mock
# Default to turning off all but critical logging messages
logging.basicConfig(level=logging.CRITICAL)
def mock_open_url(url, allow_local=False, timeout=None, verify_ssl=True, http_headers=None):
"""Open local files instead of URLs.
If it's a local file ... | 31.371429 | 92 | 0.691257 | import logging
import os
import re
import unittest.mock
logging.basicConfig(level=logging.CRITICAL)
def mock_open_url(url, allow_local=False, timeout=None, verify_ssl=True, http_headers=None):
if re.match(r'https?:', url):
filename = re.sub(r'^.*/([^/]+)$', '\\1', url)
path = resolve_pat... | true | true |
f7284a0fc1576b461e592f8ca835c0f4597e80a3 | 9,041 | py | Python | methylcapsnet/.ipynb_checkpoints/methylcaps_model_-checkpoint.py | Christensen-Lab-Dartmouth/MethylCapsNet | 17b6b19809c5e1984de804eb34cc7494210f91a6 | [
"MIT"
] | 3 | 2020-10-22T18:53:33.000Z | 2022-03-19T16:27:41.000Z | methylcapsnet/.ipynb_checkpoints/methylcaps_model_-checkpoint.py | Christensen-Lab-Dartmouth/MethylCapsNet | 17b6b19809c5e1984de804eb34cc7494210f91a6 | [
"MIT"
] | 3 | 2020-10-01T04:56:09.000Z | 2020-10-01T04:56:46.000Z | methylcapsnet/.ipynb_checkpoints/methylcaps_model_-checkpoint.py | Christensen-Lab-Dartmouth/MethylCapsNet | 17b6b19809c5e1984de804eb34cc7494210f91a6 | [
"MIT"
] | 1 | 2020-08-31T17:07:49.000Z | 2020-08-31T17:07:49.000Z | import pandas as pd
from pymethylprocess.MethylationDataTypes import MethylationArray
from sklearn.metrics import mean_absolute_error, r2_score
import warnings
warnings.filterwarnings("ignore")
from pybedtools import BedTool
import numpy as np
from functools import reduce
from torch.utils.data import Dataset, DataLoade... | 34.907336 | 167 | 0.759982 | import pandas as pd
from pymethylprocess.MethylationDataTypes import MethylationArray
from sklearn.metrics import mean_absolute_error, r2_score
import warnings
warnings.filterwarnings("ignore")
from pybedtools import BedTool
import numpy as np
from functools import reduce
from torch.utils.data import Dataset, DataLoade... | true | true |
f7284b98b0f6a7bac4cce914ee74071f35acb4ad | 223 | py | Python | base/utils/auto_str_decorator.py | PeterStuck/teacher-app | e71c5b69019450a9ac8694fb461d343ce33e1b35 | [
"CC0-1.0"
] | null | null | null | base/utils/auto_str_decorator.py | PeterStuck/teacher-app | e71c5b69019450a9ac8694fb461d343ce33e1b35 | [
"CC0-1.0"
] | null | null | null | base/utils/auto_str_decorator.py | PeterStuck/teacher-app | e71c5b69019450a9ac8694fb461d343ce33e1b35 | [
"CC0-1.0"
] | null | null | null | def auto_str(cls):
def __str__(self):
return '%s(%s)' % (
type(self).__name__,
', '.join('%s=%s' % item for item in vars(self).items())
)
cls.__str__ = __str__
return cls | 24.777778 | 68 | 0.493274 | def auto_str(cls):
def __str__(self):
return '%s(%s)' % (
type(self).__name__,
', '.join('%s=%s' % item for item in vars(self).items())
)
cls.__str__ = __str__
return cls | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.