hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8bf44c87cf42475300207d01f401d10e9f9cce97 | 1,340 | py | Python | hypertrophy_classifier.py | dozsam13/LHYP | af7115c115fdff51399b83cd1a515bf2c6f7879d | [
"MIT"
] | null | null | null | hypertrophy_classifier.py | dozsam13/LHYP | af7115c115fdff51399b83cd1a515bf2c6f7879d | [
"MIT"
] | null | null | null | hypertrophy_classifier.py | dozsam13/LHYP | af7115c115fdff51399b83cd1a515bf2c6f7879d | [
"MIT"
] | null | null | null | import torch.nn as nn | 49.62963 | 146 | 0.597761 | import torch.nn as nn
import torch
class HypertrophyClassifier(nn.Module):
def __init__(self):
super(HypertrophyClassifier, self).__init__()
self.conv = nn.Conv2d(in_channels=3, out_channels=9, kernel_size=(3,3), stride=1) # (c=3, (224,224)) => (c=9, (222, 222))
self.conv2 = nn.Conv2d(... | 0 | 0 | 0 | 1,283 | 0 | 0 | 0 | -9 | 45 |
2bbf31c5c71a06fd3158f6385d92a50a5a48afab | 6,284 | py | Python | get_paper.py | IndexFziQ/nn4nlp-concepts | 78302c49879ab2c5026437b8406acd102ac09922 | [
"BSD-3-Clause"
] | null | null | null | get_paper.py | IndexFziQ/nn4nlp-concepts | 78302c49879ab2c5026437b8406acd102ac09922 | [
"BSD-3-Clause"
] | null | null | null | get_paper.py | IndexFziQ/nn4nlp-concepts | 78302c49879ab2c5026437b8406acd102ac09922 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import random
import itertools
import os
import sys
import rule_classifier as paper_classifier
import urllib.request
import bs4 as bs
import time
def label_paper(paper_id = None, paper_meta = None, cased_regexes = None, feature = None):
"""Label one paper
:param paper_id: The paper ID
:param ... | 39.772152 | 120 | 0.628899 | import argparse
import random
import itertools
import os
import sys
import rule_classifier as paper_classifier
import urllib.request
import bs4 as bs
import time
def label_paper(paper_id = None, paper_meta = None, cased_regexes = None, feature = None):
"""Label one paper
:param paper_id: The paper ID
:param ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1a93193c3556b37f3008c3e0b176715b7d76eece | 2,972 | py | Python | etl/parsers/etw/Microsoft_Windows_Store.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 104 | 2020-03-04T14:31:31.000Z | 2022-03-28T02:59:36.000Z | etl/parsers/etw/Microsoft_Windows_Store.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 7 | 2020-04-20T09:18:39.000Z | 2022-03-19T17:06:19.000Z | etl/parsers/etw/Microsoft_Windows_Store.py | IMULMUL/etl-parser | 76b7c046866ce0469cd129ee3f7bb3799b34e271 | [
"Apache-2.0"
] | 16 | 2020-03-05T18:55:59.000Z | 2022-03-01T10:19:28.000Z | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-Store
GUID : 9c2a37f3-e5fd-5cae-bcd1-43dafeee1ff0
"""
| 29.137255 | 123 | 0.662853 | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-Store
GUID : 9c2a37f3-e5fd-5cae-bcd1-43dafeee1ff0
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.parse... | 0 | 2,397 | 0 | 0 | 0 | 0 | 0 | 170 | 295 |
007f12560628e0c366654044669fea6a370b638d | 2,289 | py | Python | nxstart/cli.py | roedesh/nxstart | ad1470aeae865270267322e265669f38945e268a | [
"MIT"
] | 40 | 2018-06-19T02:28:00.000Z | 2021-11-14T20:00:34.000Z | nxstart/cli.py | roedesh/nxstart | ad1470aeae865270267322e265669f38945e268a | [
"MIT"
] | 2 | 2018-06-19T09:49:36.000Z | 2018-12-02T13:14:26.000Z | nxstart/cli.py | roedesh/nxstart | ad1470aeae865270267322e265669f38945e268a | [
"MIT"
] | 4 | 2018-06-19T09:19:29.000Z | 2020-03-31T14:35:12.000Z | # -*- coding: utf-8 -*-
"""Defines the app context and commands."""
import click
pass_context = click.make_pass_decorator(Context, ensure=True)
| 23.121212 | 81 | 0.660987 | # -*- coding: utf-8 -*-
"""Defines the app context and commands."""
import os
import click
from nxstart import app
from nxstart.utils.strings import TITLE_TEXT, VERSION_STRING
from nxstart.version import __version__ as version
class Context(object):
"""
Context to be passed to the sub-commands.
"""
... | 0 | 1,678 | 0 | 171 | 0 | 0 | 0 | 58 | 228 |
4ddb3c4973b5aa3219dd362c09394279d92bf458 | 4,272 | py | Python | bob/devtools/scripts/settings.py | bioidiap/bob.devtools | 98ec996056a1e11d6d9c91b619441610fbf60bbe | [
"BSD-3-Clause"
] | null | null | null | bob/devtools/scripts/settings.py | bioidiap/bob.devtools | 98ec996056a1e11d6d9c91b619441610fbf60bbe | [
"BSD-3-Clause"
] | null | null | null | bob/devtools/scripts/settings.py | bioidiap/bob.devtools | 98ec996056a1e11d6d9c91b619441610fbf60bbe | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from ..log import echo_info, echo_normal, get_logger
logger = get_logger(__name__)
def _change_settings(project, info, dry_run):
"""Updates the project settings using ``info``"""
name = f"{project.namespace['name']}/{project.name}"
echo_normal(f"Changing {name}...")
if info.... | 27.384615 | 85 | 0.561096 | #!/usr/bin/env python
import os
import click
from ..log import echo_info, echo_normal, get_logger, verbosity_option
from ..release import get_gitlab_instance
from . import bdt
from .runners import (
_get_project,
_get_projects_from_file,
_get_projects_from_group,
)
logger = get_logger(__name__)
def _... | 0 | 3,014 | 0 | 0 | 0 | 0 | 0 | 93 | 135 |
a17428856529f53921875b7fda2fe54ccd69c151 | 145 | py | Python | api/authentication/models.py | HARSHIT-GUPTA-coder/OCDE | d1b4cc6ed0dde78149725be8e2809218f9c53bc5 | [
"MIT"
] | null | null | null | api/authentication/models.py | HARSHIT-GUPTA-coder/OCDE | d1b4cc6ed0dde78149725be8e2809218f9c53bc5 | [
"MIT"
] | null | null | null | api/authentication/models.py | HARSHIT-GUPTA-coder/OCDE | d1b4cc6ed0dde78149725be8e2809218f9c53bc5 | [
"MIT"
] | null | null | null | # Create your models here.
| 29 | 44 | 0.827586 | from django.db import models
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
# Create your models here.
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 52 | 66 |
1caa568abfafc7d805321c745a5b11f5c5c938da | 11,694 | py | Python | pose/CPM/genProto_cpm.py | Heliot7/viewpoint_cnn_syn | 65dfe8858d2be4a93a6e7a86e191e3ff27c1154d | [
"BSD-3-Clause"
] | 1 | 2019-12-17T11:25:00.000Z | 2019-12-17T11:25:00.000Z | pose/CPM/genProto_cpm.py | Heliot7/viewpoint_cnn_syn | 65dfe8858d2be4a93a6e7a86e191e3ff27c1154d | [
"BSD-3-Clause"
] | 1 | 2019-07-12T18:25:55.000Z | 2019-07-12T18:25:55.000Z | pose/CPM/genProto_cpm.py | Heliot7/viewpoint-cnn-syn | 65dfe8858d2be4a93a6e7a86e191e3ff27c1154d | [
"BSD-3-Clause"
] | null | null | null | import sys
import os
import math
import argparse
import json
import caffe
from caffe import layers as L # pseudo module using __getattr__ magic to generate protobuf messages
from caffe import params as P # pseudo module using __getattr__ magic to generate protobuf messages
if __name__ == "__main__":
# sys.ar... | 48.322314 | 153 | 0.577818 | import sys
import os
import math
import argparse
import json
import caffe
from caffe import layers as L # pseudo module using __getattr__ magic to generate protobuf messages
from caffe import params as P # pseudo module using __getattr__ magic to generate protobuf messages
def setLayers(data_source, data_test, batch... | 0 | 0 | 0 | 0 | 0 | 7,980 | 0 | 0 | 69 |
9b6b5e45e68696d15b016062adb20735ee5766af | 612 | py | Python | setup.py | crowsonkb/randomness | b2a865b4b0b30a3d08b3faee83d38bc3c83c1de6 | [
"MIT"
] | 1 | 2018-06-04T11:52:07.000Z | 2018-06-04T11:52:07.000Z | setup.py | crowsonkb/randomness | b2a865b4b0b30a3d08b3faee83d38bc3c83c1de6 | [
"MIT"
] | null | null | null | setup.py | crowsonkb/randomness | b2a865b4b0b30a3d08b3faee83d38bc3c83c1de6 | [
"MIT"
] | null | null | null | from pathlib import Path
from setuptools import setup
BASEDIR = Path(__file__).resolve().parent
setup(name='randomness',
version='0.1',
description='Generates random secrets (passwords, etc).',
long_description=((BASEDIR / 'README.rst').read_text()),
url='https://github.com/crowsonkb/random... | 26.608696 | 71 | 0.661765 | from pathlib import Path
from setuptools import setup
BASEDIR = Path(__file__).resolve().parent
setup(name='randomness',
version='0.1',
description='Generates random secrets (passwords, etc).',
long_description=((BASEDIR / 'README.rst').read_text()),
url='https://github.com/crowsonkb/random... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fb00d189ae9e945205311d20b83bd951db8679f9 | 9,333 | py | Python | reskin_sensor/sensor_proc.py | thomasweng15/reskin_sensor | 3c7d0df02517176a636ce276340aef389ec804e3 | [
"MIT"
] | null | null | null | reskin_sensor/sensor_proc.py | thomasweng15/reskin_sensor | 3c7d0df02517176a636ce276340aef389ec804e3 | [
"MIT"
] | null | null | null | reskin_sensor/sensor_proc.py | thomasweng15/reskin_sensor | 3c7d0df02517176a636ce276340aef389ec804e3 | [
"MIT"
] | null | null | null |
from .sensor import ReSkinSettings
if __name__ == '__main__':
test_settings = ReSkinSettings(
num_mags=5,
port="COM32",
baudrate=115200,
burst_mode=True,
device_id=1
)
# test_sensor = ReSkinBase(5, port="COM32", baudrate=115200)
test_proc = ReSkinPro... | 34.186813 | 135 | 0.56177 | import atexit
import sys
import ctypes as ct
from multiprocessing import Process, Event, Pipe, Value, Array
import serial
from .sensor import ReSkinBase, ReSkinSettings, ReSkinData
class ReSkinProcess(Process):
"""
ReSkin Sensor process. Keeps datastream running in the background.
Attr... | 0 | 306 | 0 | 7,958 | 0 | 0 | 0 | 36 | 142 |
02c109fd016dd7ca9d1dd238ed93ca3be1aa196c | 8,037 | py | Python | pyteal/ast/scratch.py | CiottiGiorgio/pyteal | 9646a1aa479786c1e80d6a3821d5db1e6c4a16e2 | [
"MIT"
] | null | null | null | pyteal/ast/scratch.py | CiottiGiorgio/pyteal | 9646a1aa479786c1e80d6a3821d5db1e6c4a16e2 | [
"MIT"
] | 1 | 2022-03-04T14:57:57.000Z | 2022-03-04T14:57:57.000Z | pyteal/ast/scratch.py | CiottiGiorgio/pyteal | 9646a1aa479786c1e80d6a3821d5db1e6c4a16e2 | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
ScratchSlot.__module__ = "pyteal"
ScratchIndex.__module__ = "pyteal"
ScratchLoad.__module__ = "pyteal"
ScratchStore.__module__ = "pyteal"
ScratchStackStore.__module__ = "pyteal"
| 30.675573 | 98 | 0.606818 | from typing import cast, TYPE_CHECKING, Optional
from pyteal.types import TealType, require_type
from pyteal.config import NUM_SLOTS
from pyteal.errors import TealInputError, TealInternalError
from pyteal.ast.expr import Expr
if TYPE_CHECKING:
from pyteal.compiler import CompileOptions
class ScratchSlot:
""... | 0 | 0 | 0 | 7,436 | 0 | 0 | 0 | 126 | 230 |
469902f18fc3b279ce0c5f708a7f28d10465ea7e | 910 | py | Python | exam/authapp/admin.py | malfin/exam_project | 8b707ff6cbd09b096273a97165adc15c28f838e0 | [
"Apache-2.0"
] | null | null | null | exam/authapp/admin.py | malfin/exam_project | 8b707ff6cbd09b096273a97165adc15c28f838e0 | [
"Apache-2.0"
] | null | null | null | exam/authapp/admin.py | malfin/exam_project | 8b707ff6cbd09b096273a97165adc15c28f838e0 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from authapp.models import KpkUser
admin.site.register(KpkUser, KpkAdmin)
| 30.333333 | 94 | 0.57033 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from authapp.models import KpkUser
class KpkAdmin(UserAdmin):
fieldsets = (
(None, {'fields': ('login', 'password')}),
('Personal info', {'fields': ('name', 'surname', 'email')}),
('Permissions', {
... | 0 | 0 | 0 | 728 | 0 | 0 | 0 | 26 | 45 |
a5a627d360f41375b74436f355ffdf26d790de9a | 258 | py | Python | DDBMS/server_sql.py | s10singh97/DBMS_Lab | 7520b05fe3bd731e72c135aa761b4331c9bff470 | [
"Apache-2.0"
] | 1 | 2018-12-09T06:55:26.000Z | 2018-12-09T06:55:26.000Z | DDBMS/server_sql.py | s10singh97/DBMS_Lab | 7520b05fe3bd731e72c135aa761b4331c9bff470 | [
"Apache-2.0"
] | null | null | null | DDBMS/server_sql.py | s10singh97/DBMS_Lab | 7520b05fe3bd731e72c135aa761b4331c9bff470 | [
"Apache-2.0"
] | 1 | 2018-10-30T10:22:40.000Z | 2018-10-30T10:22:40.000Z | import pymysql as py
conn = py.Connect("172.21.4.120","ash","password","test")
if conn:
print("Successfully Connected")
cursor = conn.cursor()
rows = cursor.execute("SHOW TABLES")
data = cursor.fetchall()
for row in data:
print(row[0])
conn.close() | 21.5 | 57 | 0.686047 | import pymysql as py
conn = py.Connect("172.21.4.120","ash","password","test")
if conn:
print("Successfully Connected")
cursor = conn.cursor()
rows = cursor.execute("SHOW TABLES")
data = cursor.fetchall()
for row in data:
print(row[0])
conn.close() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b237e92376709b47210c8591e4d4f5d94ea758d6 | 13,123 | py | Python | env.py | zchenry/bnn-analysis | 4454943967435fc80cfdc60d8e00282abb8ee201 | [
"MIT"
] | null | null | null | env.py | zchenry/bnn-analysis | 4454943967435fc80cfdc60d8e00282abb8ee201 | [
"MIT"
] | null | null | null | env.py | zchenry/bnn-analysis | 4454943967435fc80cfdc60d8e00282abb8ee201 | [
"MIT"
] | null | null | null | """ This module defines the Env class that describes a data setup for experiments and runs the sampling. """
import logging
import evaluation.metrics as metrics
# add console logger
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)s] %(message)s', datefmt='%H:%M:%S')
| 40.131498 | 127 | 0.599101 | """ This module defines the Env class that describes a data setup for experiments and runs the sampling. """
import logging
from time import perf_counter as pc
from datetime import datetime
import numpy as np
import tensorflow as tf
from sklearn.model_selection import KFold
import evaluation.metrics as metrics
import u... | 0 | 0 | 0 | 12,655 | 0 | 0 | 0 | 32 | 155 |
8e8abc7d61240f63cf57b4708544c8df44cd9917 | 1,345 | py | Python | base/base_model.py | SIAAAAAA/C3-SemiSeg | b2e2489b828661660d9842785e831293bab5cd47 | [
"MIT"
] | 5 | 2021-11-12T11:21:23.000Z | 2022-03-08T01:58:12.000Z | base/base_model.py | SIAAAAAA/C3-SemiSeg | b2e2489b828661660d9842785e831293bab5cd47 | [
"MIT"
] | 1 | 2022-03-12T08:06:56.000Z | 2022-03-12T08:06:56.000Z | base/base_model.py | SIAAAAAA/C3-SemiSeg | b2e2489b828661660d9842785e831293bab5cd47 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 36.351351 | 114 | 0.651301 | import logging
import numpy as np
import torch
import torch.nn as nn
class BaseModel(nn.Module):
def __init__(self):
super(BaseModel, self).__init__()
self.logger = logging.getLogger(self.__class__.__name__)
self.model_names = []
def forward(self):
raise NotImplementedError
... | 0 | 0 | 0 | 1,252 | 0 | 0 | 0 | -19 | 89 |
a396fb32d5cdb83d8bdb48551d55ac290cd00b2b | 396 | py | Python | config.py | Sagi10/Project-Bigdata | 7179b83a714b736e6467b16787dfb554cd2c5fa0 | [
"MIT",
"Unlicense"
] | null | null | null | config.py | Sagi10/Project-Bigdata | 7179b83a714b736e6467b16787dfb554cd2c5fa0 | [
"MIT",
"Unlicense"
] | null | null | null | config.py | Sagi10/Project-Bigdata | 7179b83a714b736e6467b16787dfb554cd2c5fa0 | [
"MIT",
"Unlicense"
] | null | null | null |
# Database connection setup
| 24.75 | 105 | 0.659091 | import os
# Database connection setup
class Config(object):
SERVER = ''
DATABASE = ''
DRIVER = ''
USERNAME = ''
PASSWORD = ''
SQLALCHEMY_DATABASE_URI = f'mssql+pyodbc://{USERNAME}:{PASSWORD}@{SERVER}/{DATABASE}?driver={DRIVER}'
SQLALCHEMY_TRACK_MODIFICATIONS = False
DEBUG = True
S... | 0 | 0 | 0 | 334 | 0 | 0 | 0 | -12 | 44 |
235a3d4ff0e5d1bf5fecc1e13735fcee732041fe | 256 | py | Python | service-workers/service-worker/resources/404.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | service-workers/service-worker/resources/404.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | service-workers/service-worker/resources/404.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # iframe does not fire onload event if the response's content-type is not
# text/plain or text/html so this script exists if you want to test a 404 load
# in an iframe.
| 42.666667 | 78 | 0.710938 | # iframe does not fire onload event if the response's content-type is not
# text/plain or text/html so this script exists if you want to test a 404 load
# in an iframe.
def main(req, res):
return 404, [('Content-Type', 'text/plain')], "Page not found"
| 0 | 0 | 0 | 0 | 0 | 65 | 0 | 0 | 22 |
517c22cfe82043b38d80851cd70c2a6b3727da78 | 1,001 | py | Python | tests/integration/modules/test_chocolatey.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 1 | 2020-07-22T18:41:34.000Z | 2020-07-22T18:41:34.000Z | tests/integration/modules/test_chocolatey.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 2 | 2021-04-30T21:17:57.000Z | 2021-12-13T20:40:23.000Z | tests/integration/modules/test_chocolatey.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 1 | 2015-08-26T09:46:04.000Z | 2015-08-26T09:46:04.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
| 29.441176 | 84 | 0.701299 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
import salt.modules.chocolatey as choco
import salt.utils.platform
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.unit import skipIf
@skipIf(not salt.utils.platform.is_windows... | 0 | 701 | 0 | 0 | 0 | 0 | 0 | 79 | 156 |
54b275eb16735587a1855a2f0bdbedc10d14a7d7 | 103 | py | Python | Bangu/Semana 4/Exemplo007/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | 2 | 2022-03-25T02:04:11.000Z | 2022-03-25T09:26:44.000Z | Bangu/Semana 4/Exemplos de Sala de Aula/Exemplo007/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | null | null | null | Bangu/Semana 4/Exemplos de Sala de Aula/Exemplo007/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | null | null | null | # Desenvolva um algoritmo em Python que exiba os nmeros de 1 a 10
for i in range(1,11,1):
print(i) | 20.6 | 66 | 0.708738 | # Desenvolva um algoritmo em Python que exiba os números de 1 a 10
for i in range(1,11,1):
print(i) | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d563aab732864dee1d4c974c112d8fdbf4d1c265 | 4,480 | py | Python | aaxus/api/authentication.py | JonLMyers/MetroTransitAPI | d8f467570368cd563d69564b680cfdd47ad6b622 | [
"MIT"
] | null | null | null | aaxus/api/authentication.py | JonLMyers/MetroTransitAPI | d8f467570368cd563d69564b680cfdd47ad6b622 | [
"MIT"
] | null | null | null | aaxus/api/authentication.py | JonLMyers/MetroTransitAPI | d8f467570368cd563d69564b680cfdd47ad6b622 | [
"MIT"
] | null | null | null | """ Authentication Managment API """
from flask_restful import reqparse
parser = reqparse.RequestParser()
parser.add_argument('username', help = 'This field cannot be blank', required = True)
parser.add_argument('password', help = 'This field cannot be blank', required = True) | 35.555556 | 147 | 0.616964 | """ Authentication Managment API """
import json
from flask import jsonify, request
from flask_restful import Resource, reqparse
from aaxus import rest_api
from aaxus.models.user import User
from aaxus.models.token import RevokedToken
from aaxus.services.confirm_email import generate_confirmation_token, confirm_token
f... | 0 | 830 | 0 | 2,633 | 0 | 0 | 0 | 267 | 472 |
830e4dc5902bdde8b1fa900975eb2f5de536a7dd | 2,041 | py | Python | rurina2/widgets/seekbar.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | rurina2/widgets/seekbar.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | rurina2/widgets/seekbar.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null |
__all__ = [
'HSeekbar'
]
| 30.014706 | 111 | 0.577658 | from widgets.button import DraggableButton
from prefabs.inputter import pressed
from base_node import get_surface
from widgets.progressbar import *
from prefabs.surface import blit
from shape import Circle
import pygame
class HSeekbar(HProgressBar):
hovered = pressed = False
def __init__(self, *args, thumb_c... | 0 | 0 | 0 | 1,766 | 0 | 0 | 0 | 66 | 177 |
c592d14c7fed3cf420a8da1908a48c85bf4957eb | 5,834 | py | Python | app/DBModel.py | Bye-lemon/Open-Lab-Management-System | f72197cd4cf9979868a74c89b493ffc6047ab933 | [
"MIT"
] | 2 | 2018-08-20T07:39:09.000Z | 2021-08-04T12:10:18.000Z | app/DBModel.py | Bye-lemon/Open-Lab-Management-System | f72197cd4cf9979868a74c89b493ffc6047ab933 | [
"MIT"
] | null | null | null | app/DBModel.py | Bye-lemon/Open-Lab-Management-System | f72197cd4cf9979868a74c89b493ffc6047ab933 | [
"MIT"
] | null | null | null | from . import login_manager
login_manager.anonymous_user = AnonymousUser
# | 31.365591 | 96 | 0.631985 | from flask import current_app
from flask_login import UserMixin, AnonymousUserMixin
import hashlib
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from werkzeug.security import generate_password_hash, check_password_hash
from . import db, login_manager
class Permission:
ACCESS = 1
RENT ... | 18 | 1,239 | 0 | 4,048 | 0 | 0 | 0 | 138 | 317 |
c6cd5547ae9d02f6abe1e847bd89b6af58659d03 | 2,105 | py | Python | fitbenchmarking/utils/log.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 6 | 2019-07-22T01:56:10.000Z | 2021-12-10T05:29:30.000Z | fitbenchmarking/utils/log.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 677 | 2019-04-29T10:23:49.000Z | 2022-03-22T12:01:30.000Z | fitbenchmarking/utils/log.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 8 | 2019-06-13T10:32:17.000Z | 2020-12-09T15:08:40.000Z | """
Utility functions to support logging for the fitbenchmarking
project.
"""
import logging
import sys
def setup_logger(log_file='./fitbenchmarking.log', name='fitbenchmarking',
append=False, level='INFO'):
"""
Define the location and style of the log file.
:param log_file: path to the ... | 31.893939 | 78 | 0.658907 | """
Utility functions to support logging for the fitbenchmarking
project.
"""
import logging
import sys
def setup_logger(log_file='./fitbenchmarking.log', name='fitbenchmarking',
append=False, level='INFO'):
"""
Define the location and style of the log file.
:param log_file: path to the ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a2b04a774a050b592b74932e6b84e1905667488d | 985 | py | Python | tools/beerocks_analyzer/logger_setup.py | WeiXiaoQian/prplMesh | 4a86f5378d8bf77148dcfa1da474a47bd31416c1 | [
"BSD-2-Clause-Patent"
] | 85 | 2018-10-24T22:18:35.000Z | 2022-02-24T09:11:56.000Z | tools/beerocks_analyzer/logger_setup.py | WeiXiaoQian/prplMesh | 4a86f5378d8bf77148dcfa1da474a47bd31416c1 | [
"BSD-2-Clause-Patent"
] | 1,105 | 2018-10-03T14:04:58.000Z | 2020-08-14T21:22:55.000Z | tools/beerocks_analyzer/logger_setup.py | WeiXiaoQian/prplMesh | 4a86f5378d8bf77148dcfa1da474a47bd31416c1 | [
"BSD-2-Clause-Patent"
] | 43 | 2018-11-12T22:51:40.000Z | 2021-12-26T07:40:39.000Z | import logging
| 28.970588 | 87 | 0.674112 | import logging
import logging.config
import yaml
class StderrFilter(logging.Filter):
"""Simple filter which only outputs the following levels: WARNING, ERROR, CRITICAL.
"""
def filter(self, rec):
return rec.levelno in (logging.WARNING, logging.ERROR, logging.CRITICAL)
def setup_logger():
wi... | 0 | 0 | 0 | 671 | 0 | 193 | 0 | -10 | 113 |
14794996cf5cc4c97234a6d47ee5b25a2cf5a071 | 2,019 | py | Python | src/prepare_corpus/prepare_chat.py | lingeen/lingeen-Ying | b7d4771d556e2168bd3dfae15b39336046319a9c | [
"Apache-2.0"
] | null | null | null | src/prepare_corpus/prepare_chat.py | lingeen/lingeen-Ying | b7d4771d556e2168bd3dfae15b39336046319a9c | [
"Apache-2.0"
] | null | null | null | src/prepare_corpus/prepare_chat.py | lingeen/lingeen-Ying | b7d4771d556e2168bd3dfae15b39336046319a9c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/12/27 10:58 PM
# @Author : Kevin
if __name__ == '__main__':
# cut_chat_data_by_character()
clean_blank_pair()
| 35.421053 | 111 | 0.684497 | # -*- coding: utf-8 -*-
# @Time : 2020/12/27 10:58 PM
# @Author : Kevin
from src.utils.sentence_process import cut_sentence_by_character
from tqdm import tqdm
from src import config
def cut_chat_data_by_character():
asks=open(config.project_home_path_prefix+"/data/chat/ask.txt",'r').readlines()
with open... | 48 | 0 | 0 | 0 | 0 | 1,683 | 0 | 44 | 112 |
3024091a4fe382c0c7160623dc086f20d381b1e8 | 4,702 | py | Python | MotorControl1/leg_animation.py | albertgo98/BipedalRobot | dc354061fceec5317f441901f842afc889167edb | [
"MIT"
] | null | null | null | MotorControl1/leg_animation.py | albertgo98/BipedalRobot | dc354061fceec5317f441901f842afc889167edb | [
"MIT"
] | null | null | null | MotorControl1/leg_animation.py | albertgo98/BipedalRobot | dc354061fceec5317f441901f842afc889167edb | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button
import math
#Define Link Lengths
l1 = 2
l2 = 4.977
l3 = 2
l4 = 4
l5 = 1.5
l6 = 6
#Initial Motorized Joint Angles
theta_1 = -(math.pi/180)*110
theta_4 = -(math.pi/180)*80
#Fixed Joint A Position
A_x = 0
A_y = 0
#Fixed Joint E Position
E_x... | 21.276018 | 78 | 0.671629 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button
import math
from scipy.optimize import fsolve
def equations(vars, *args):
x, y = vars
eq1 = (args[0]-x)**2+(args[1]-y)**2-l2**2
eq2 = (args[2]-x)**2+(args[3]-y)**2-l3**2
return [eq1, eq2]
#Define Link Lengths
l1 ... | 0 | 0 | 0 | 0 | 0 | 1,916 | 0 | 9 | 113 |
dd8ae9bac29601db4cfa6829363b7f9d800c654f | 2,444 | py | Python | common/test/test_common_funcs.py | eribean/RyStats | 1cdd0ea55a074cc81e61d2845216f395ba095f10 | [
"MIT"
] | 4 | 2021-08-05T11:47:30.000Z | 2021-10-31T12:03:48.000Z | common/test/test_common_funcs.py | eribean/RyStats | 1cdd0ea55a074cc81e61d2845216f395ba095f10 | [
"MIT"
] | 12 | 2021-08-05T11:43:22.000Z | 2021-10-29T18:05:48.000Z | common/test/test_common_funcs.py | eribean/RyStats | 1cdd0ea55a074cc81e61d2845216f395ba095f10 | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main() | 35.941176 | 75 | 0.644845 | import unittest
import numpy as np
from RyStats.common import entropy, hypersphere, procrustes_rotation
class TestCommonFunctions(unittest.TestCase):
"""Tests fixture for the common functions."""
def test_entropy(self):
"""Testing entropy calculations."""
# One value in each column should h... | 0 | 0 | 0 | 2,268 | 0 | 0 | 0 | 44 | 69 |
a7900cc4ec96dee2a0e9be99b04a3748a6903f1d | 5,199 | py | Python | tensorflow_graphics/rendering/tests/rasterization_test_utils.py | Tensorflow-Devs/graphics | e03fb62b8ee15a026bde7e27e4f3aa5ebc9413a1 | [
"Apache-2.0"
] | null | null | null | tensorflow_graphics/rendering/tests/rasterization_test_utils.py | Tensorflow-Devs/graphics | e03fb62b8ee15a026bde7e27e4f3aa5ebc9413a1 | [
"Apache-2.0"
] | null | null | null | tensorflow_graphics/rendering/tests/rasterization_test_utils.py | Tensorflow-Devs/graphics | e03fb62b8ee15a026bde7e27e4f3aa5ebc9413a1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 39.386364 | 79 | 0.728025 | # Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 0 | 0 | 0 | 0 | 0 | 64 | 0 | 0 | 23 |
bdfa321a6f6c992562487a7695a81c379316beca | 1,366 | py | Python | vectornet/main.py | chickenfingerwu/pytorch-CycleGAN-and-pix2pix | 367033f7d265fc7307ed0c917a4f8d19b298e6b7 | [
"BSD-3-Clause"
] | null | null | null | vectornet/main.py | chickenfingerwu/pytorch-CycleGAN-and-pix2pix | 367033f7d265fc7307ed0c917a4f8d19b298e6b7 | [
"BSD-3-Clause"
] | null | null | null | vectornet/main.py | chickenfingerwu/pytorch-CycleGAN-and-pix2pix | 367033f7d265fc7307ed0c917a4f8d19b298e6b7 | [
"BSD-3-Clause"
] | null | null | null | from config import get_config
if __name__ == "__main__":
config, unparsed = get_config()
main(config)
| 31.045455 | 54 | 0.625183 | from config import get_config
from utils import prepare_dirs_and_logger, save_config
def main(config):
prepare_dirs_and_logger(config)
save_config(config)
if config.is_train:
from trainer import Trainer
if config.dataset == 'line':
from data_line import BatchManager
el... | 0 | 0 | 0 | 0 | 0 | 1,175 | 0 | 33 | 45 |
d1ccffa481c9fd8b36ac469a66a71168dcb228c3 | 91 | py | Python | utils/directories.py | Speters1086/res_strava_reader | cab5e98d40df451251b20584155fad68767e97d9 | [
"MIT"
] | null | null | null | utils/directories.py | Speters1086/res_strava_reader | cab5e98d40df451251b20584155fad68767e97d9 | [
"MIT"
] | 3 | 2020-09-29T08:25:39.000Z | 2020-09-29T08:26:55.000Z | utils/directories.py | Speters1086/res_strava_reader | cab5e98d40df451251b20584155fad68767e97d9 | [
"MIT"
] | null | null | null | import os
PROJECT_ROOT_DIR = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir)) | 30.333333 | 80 | 0.78022 | import os
PROJECT_ROOT_DIR = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bb15e1e433cd27112b9b2c8ee4a9ff9f77dd179a | 3,792 | py | Python | util/probabilistic_ordinal_embedding.py | narutatsuri/uniform-distribution-corpus-generator | 9c2ca1db3495ff160ba43fc86ce356e1a4eca792 | [
"MIT"
] | null | null | null | util/probabilistic_ordinal_embedding.py | narutatsuri/uniform-distribution-corpus-generator | 9c2ca1db3495ff160ba43fc86ce356e1a4eca792 | [
"MIT"
] | null | null | null | util/probabilistic_ordinal_embedding.py | narutatsuri/uniform-distribution-corpus-generator | 9c2ca1db3495ff160ba43fc86ce356e1a4eca792 | [
"MIT"
] | null | null | null | from tqdm import tqdm
import itertools
def probabilistic_ordinal_embedding_prepare_data_for_training(dataset,
model):
"""
"""
triplets = []
for word_index, word in tqdm(enumerate(dataset)):
# Get words within wi... | 41.67033 | 137 | 0.589662 | from util.functions import *
from util import *
from tqdm import tqdm
import matplotlib.pyplot as plt
import itertools
class probabilistic_ordinal_embedding(object):
def __init__(self, dimension):
self.N = dimension
self.X_train = []
self.alpha = 0.0001
self.onehots = get_onehots(s... | 0 | 0 | 0 | 2,246 | 0 | 0 | 0 | 14 | 89 |
6381b9238a0d7b759f27af4599f8bcd432a5514f | 4,219 | py | Python | shops/frame_test.py | haihai210/tcds | c7138750d3003a5904a2c4dcfd6bd00527447e5e | [
"Apache-2.0"
] | null | null | null | shops/frame_test.py | haihai210/tcds | c7138750d3003a5904a2c4dcfd6bd00527447e5e | [
"Apache-2.0"
] | null | null | null | shops/frame_test.py | haihai210/tcds | c7138750d3003a5904a2c4dcfd6bd00527447e5e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 12 17:17:09 2017
@author: sh
"""
import numpy as np
import pandas as pd
import pickle
import tools_lib as tool
import math
load_predata_path = 'F:\\tcds\\shop\\predata\\'
file = open(load_predata_path + 'data_mall_shop.pkl', 'rb')
mall = pickle.load(file)... | 40.567308 | 138 | 0.57004 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 12 17:17:09 2017
@author: sh
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle
import tools_lib as tool
import math
load_predata_path = 'F:\\tcds\\shop\\predata\\'
file = open(load_predata_path + 'data_mall_shop.pkl'... | 114 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 23 |
da8967fce9299c69f20e117d98640cbdaf3d0812 | 8,555 | py | Python | tests/test_environments.py | UTexas-PSAAP/Parla.py | 3d92a156be41983e32576940ef6baffd78d4eb84 | [
"BSD-3-Clause"
] | 11 | 2020-06-22T16:20:15.000Z | 2022-03-20T22:54:40.000Z | tests/test_environments.py | UTexas-PSAAP/Parla.py | 3d92a156be41983e32576940ef6baffd78d4eb84 | [
"BSD-3-Clause"
] | 86 | 2019-10-24T07:43:05.000Z | 2022-03-28T05:20:17.000Z | tests/test_environments.py | UTexas-PSAAP/Parla.py | 3d92a156be41983e32576940ef6baffd78d4eb84 | [
"BSD-3-Clause"
] | 7 | 2019-10-24T05:46:27.000Z | 2022-02-09T19:47:58.000Z | import logging
import threading
from time import sleep
logger = logging.getLogger(__name__)
def repetitions():
"""Return an iterable of the repetitions to perform for probabilistic/racy tests."""
return range(5)
def sleep_until(predicate, timeout=2, period=0.05):
"""Sleep until either `predicate()` is t... | 37.358079 | 111 | 0.611689 | import logging
import threading
from time import sleep
import pytest
from parla import Parla, TaskEnvironment
from parla.cpu import cpu
from parla.environments import EnvironmentComponentInstance, EnvironmentComponentDescriptor
from parla.tasks import *
logger = logging.getLogger(__name__)
def repetitions():
""... | 0 | 5,976 | 0 | 1,024 | 0 | 576 | 0 | 89 | 319 |
c835af8e95bd7e7754f6f34f2a6e360fe5a23bf7 | 2,148 | py | Python | tests/test_dates.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-common | 283a72e796915c99cc5ed53b44f67d79628ffac8 | [
"MIT"
] | 7 | 2016-01-05T12:21:57.000Z | 2020-01-17T07:23:31.000Z | tests/test_dates.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-common | 283a72e796915c99cc5ed53b44f67d79628ffac8 | [
"MIT"
] | 82 | 2015-09-30T11:52:54.000Z | 2022-03-28T09:11:21.000Z | tests/test_dates.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-common | 283a72e796915c99cc5ed53b44f67d79628ffac8 | [
"MIT"
] | 1 | 2021-04-11T06:14:15.000Z | 2021-04-11T06:14:15.000Z |
TEST_HOLIDAYS = {'england-and-wales': {
'division': 'england-and-wales',
'events': [
{'title': 'Boxing Day', 'date': '2016-12-26', 'notes': '', 'bunting': True},
{'title': 'Christmas Day', 'date': '2016-12-27', 'notes': 'Substitute day', 'bunting': True}]
}}
| 38.357143 | 101 | 0.696462 | from unittest import mock
from datetime import date
from django.test import SimpleTestCase
from mtp_common.dates import WorkdayChecker
TEST_HOLIDAYS = {'england-and-wales': {
'division': 'england-and-wales',
'events': [
{'title': 'Boxing Day', 'date': '2016-12-26', 'notes': '', 'bunting': True},
... | 0 | 0 | 0 | 1,703 | 0 | 0 | 0 | 47 | 113 |
6edc45ee69cb4b3cb110556b26254eff9d6e0399 | 2,414 | py | Python | attention/experiments/attention_networks_testing.py | fbickfordsmith/attention-msc | 1e816ddc9a40446096f7c6b61648e23065c54d5b | [
"MIT"
] | 1 | 2020-06-21T07:55:44.000Z | 2020-06-21T07:55:44.000Z | attention/experiments/attention_networks_testing.py | fbickfordsmith/attention | 1e816ddc9a40446096f7c6b61648e23065c54d5b | [
"MIT"
] | null | null | null | attention/experiments/attention_networks_testing.py | fbickfordsmith/attention | 1e816ddc9a40446096f7c6b61648e23065c54d5b | [
"MIT"
] | null | null | null | """
Test attention networks on ImageNet.
"""
gpu = input('GPU: ')
type_category_set = input('Category-set type in {diff, sem, sim, size}: ')
version_wnids = input('Version number (WNIDs): ')
version_weights = input('Version number (weights): ')
start = int(input('Start category set: '))
stop = int(input('Stop category... | 38.935484 | 80 | 0.735708 | """
Test attention networks on ImageNet.
"""
gpu = input('GPU: ')
type_category_set = input('Category-set type in {diff, sem, sim, size}: ')
version_wnids = input('Version number (WNIDs): ')
version_weights = input('Version number (weights): ')
start = int(input('Start category set: '))
stop = int(input('Stop category... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 |
136dd0b8714a32a8c10e304ef9ffafb08f9b2474 | 758 | py | Python | test.py | thevaccinetracker/data_engine | 5a0c43cf0653a0b0f1e3da6c0f2d605aef143a07 | [
"MIT"
] | null | null | null | test.py | thevaccinetracker/data_engine | 5a0c43cf0653a0b0f1e3da6c0f2d605aef143a07 | [
"MIT"
] | null | null | null | test.py | thevaccinetracker/data_engine | 5a0c43cf0653a0b0f1e3da6c0f2d605aef143a07 | [
"MIT"
] | null | null | null | statement = """"Institute of Medical Biology, Chinese Academy of Medical Sciences",Vaccine,Inactivated virus,Phase II,Phase II began June 2020,Inactivated,NCT04412538,Unknown,,,N/A,https://docs.google.com/document/d/1Y4nCJJ4njzD1wiHbufCY6gqfRmj49Qn_qNgOJD62Wik/edit,6/23/2020"""
parseRowToCell(statement) | 36.095238 | 278 | 0.645119 | statement = """"Institute of Medical Biology, Chinese Academy of Medical Sciences",Vaccine,Inactivated virus,Phase II,Phase II began June 2020,Inactivated,NCT04412538,Unknown,,,N/A,https://docs.google.com/document/d/1Y4nCJJ4njzD1wiHbufCY6gqfRmj49Qn_qNgOJD62Wik/edit,6/23/2020"""
def parseRowToCell(row):
isSingleWo... | 0 | 0 | 0 | 0 | 0 | 429 | 0 | 0 | 23 |
29257d470b4037494c38c2b98a791beb890fc0a8 | 10,468 | py | Python | tune_sklearn/_trainable.py | holgern/tune-sklearn | a16b5e1726911db5d03770b0d5c77eda6c8937ed | [
"Apache-2.0"
] | null | null | null | tune_sklearn/_trainable.py | holgern/tune-sklearn | a16b5e1726911db5d03770b0d5c77eda6c8937ed | [
"Apache-2.0"
] | null | null | null | tune_sklearn/_trainable.py | holgern/tune-sklearn | a16b5e1726911db5d03770b0d5c77eda6c8937ed | [
"Apache-2.0"
] | null | null | null | """ Helper class to train models using Ray backend
"""
| 37.927536 | 80 | 0.55512 | """ Helper class to train models using Ray backend
"""
import ray
from ray.tune import Trainable
from sklearn.base import clone
from sklearn.model_selection import cross_validate
from sklearn.utils.metaestimators import _safe_split
import numpy as np
import os
from pickle import PicklingError
import ray.cloudpickle as... | 0 | 56 | 0 | 9,859 | 0 | 0 | 0 | 208 | 289 |
867b49dd16e43d71eee9efabd6f31114e794ac04 | 651 | py | Python | src/dsfs/linalg/matrix.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | src/dsfs/linalg/matrix.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | src/dsfs/linalg/matrix.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | from typing import List
Matrix = List[List[float]]
| 23.25 | 85 | 0.662058 | from typing import List, Tuple, Callable
from dsfs.linalg.vector import Vector
Matrix = List[List[float]]
def shape(A: Matrix) -> Tuple[int, int]:
num_rows = len(A)
num_cols = len(A[0]) if A else 0
return num_rows, num_cols
def get_row(A: Matrix, i: int) -> Vector:
return A[i]
def get_column(A: ... | 0 | 0 | 0 | 0 | 0 | 423 | 0 | 33 | 138 |
a1c01a9ec80e340aef33ae7d3eb75484d417c4b9 | 379 | py | Python | src/split_stub.py | Sriharsha-Pamidi/Multi-Class-Fit-Prediction | 52577977d85060c2713b83646593b708e561b7ce | [
"MIT"
] | null | null | null | src/split_stub.py | Sriharsha-Pamidi/Multi-Class-Fit-Prediction | 52577977d85060c2713b83646593b708e561b7ce | [
"MIT"
] | null | null | null | src/split_stub.py | Sriharsha-Pamidi/Multi-Class-Fit-Prediction | 52577977d85060c2713b83646593b708e561b7ce | [
"MIT"
] | 1 | 2022-01-12T06:20:34.000Z | 2022-01-12T06:20:34.000Z | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
dataset = pd.read_json('../data/renttherunway_final_data.json.gz', lines=True)
dataset = dataset.dropna()
train_data, validation_data, test_data = np.split(dataset.sample(frac=1, random_state=42),
... | 23.6875 | 96 | 0.630607 | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
dataset = pd.read_json('../data/renttherunway_final_data.json.gz', lines=True)
dataset = dataset.dropna()
train_data, validation_data, test_data = np.split(dataset.sample(frac=1, random_state=42),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1859dd1982b8032ae6d2c4c0b3175f50a6d07d91 | 1,572 | py | Python | saleor/search/backends/postgresql_dashboard.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | null | null | null | saleor/search/backends/postgresql_dashboard.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | 1 | 2022-02-10T14:46:00.000Z | 2022-02-10T14:46:00.000Z | saleor/search/backends/postgresql_dashboard.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.postgres.search import SearchVector
from ...product.models import Product
from ...order.models import Order
from ...userprofile.models import User
def search_products(phrase):
'''Dashboard full text product search'''
sv = SearchVector('name', 'description')
return Product.objects.anno... | 29.660377 | 72 | 0.680662 | from django.contrib.postgres.search import SearchVector
from ...product.models import Product
from ...order.models import Order
from ...userprofile.models import User
def search_products(phrase):
'''Dashboard full text product search'''
sv = SearchVector('name', 'description')
return Product.objects.anno... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4abe19c89e4f72f2631c8e376ba5637438a8b590 | 455 | py | Python | menubuilder/templatetags/menubuilder_tags.py | marsxn/menu-builder | eced8a4f797a4630c49bec693ac69f7798693afd | [
"MIT"
] | null | null | null | menubuilder/templatetags/menubuilder_tags.py | marsxn/menu-builder | eced8a4f797a4630c49bec693ac69f7798693afd | [
"MIT"
] | null | null | null | menubuilder/templatetags/menubuilder_tags.py | marsxn/menu-builder | eced8a4f797a4630c49bec693ac69f7798693afd | [
"MIT"
] | null | null | null | # -*- enconding:utf-8 -*-
from django import template
register = template.Library()
| 23.947368 | 61 | 0.650549 | # -*- enconding:utf-8 -*-
from django import template
from menubuilder.models import Menu
register = template.Library()
@register.inclusion_tag("tags/menu.html", takes_context=True)
def create_menu(context, slug):
try:
menu = Menu.objects.get(slug__iexact=slug)
except Menu.DoesNotExist:
menu... | 0 | 309 | 0 | 0 | 0 | 0 | 0 | 14 | 46 |
1b941d08ee8e5de16318abc96e8c2d8aeb8e53e2 | 12,010 | py | Python | src/OrderbookAnalyser.py | gbarany/crypto-arbitrage-finder | 8b1dcf14cce795f4d0bbfa640abf3e13fe75eedb | [
"Apache-2.0"
] | 6 | 2020-02-25T09:40:57.000Z | 2022-03-30T09:20:02.000Z | src/OrderbookAnalyser.py | gbarany/crypto-arbitrage-finder | 8b1dcf14cce795f4d0bbfa640abf3e13fe75eedb | [
"Apache-2.0"
] | null | null | null | src/OrderbookAnalyser.py | gbarany/crypto-arbitrage-finder | 8b1dcf14cce795f4d0bbfa640abf3e13fe75eedb | [
"Apache-2.0"
] | 1 | 2020-04-22T11:39:47.000Z | 2020-04-22T11:39:47.000Z | import logging
logger = logging.getLogger('CryptoArbitrageApp')
| 44.317343 | 211 | 0.634804 | from ArbitrageGraph import ArbitrageGraph
from ArbitrageGraphNeo import ArbitrageGraphNeo
from FeeStore import FeeStore
from OrderBook import OrderBook, OrderBookPair, Asset
from PriceStore import PriceStore
import datetime
import logging
from FWLiveParams import FWLiveParams
import asyncio
from utilities import timed
... | 0 | 6,481 | 415 | 4,450 | 0 | 0 | 0 | 178 | 420 |
7cdeaa648075821574cd763383a6a6403f1be995 | 61,896 | py | Python | openmmtools/storage/iodrivers.py | yihengwuKP/openmmtools | 8bf446742f75acb4008e51c0a102bb7f314d1da3 | [
"MIT"
] | 1 | 2019-11-01T14:22:57.000Z | 2019-11-01T14:22:57.000Z | openmmtools/storage/iodrivers.py | yihengwuKP/openmmtools | 8bf446742f75acb4008e51c0a102bb7f314d1da3 | [
"MIT"
] | 1 | 2019-06-13T08:27:54.000Z | 2019-06-13T08:27:54.000Z | openmmtools/storage/iodrivers.py | yihengwuKP/openmmtools | 8bf446742f75acb4008e51c0a102bb7f314d1da3 | [
"MIT"
] | null | null | null | #!/usr/bin/env/python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Module which houses all the handling instructions for reading and writing to netCDF files for a given type.
This... | 38.207407 | 122 | 0.600685 | #!/usr/bin/env/python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Module which houses all the handling instructions for reading and writing to netCDF files for a given type.
This... | 0 | 13,670 | 0 | 40,572 | 0 | 1,128 | 0 | 3 | 664 |
fc8e742db99aff6d2def1d3be59cf89186f7d0ba | 2,763 | py | Python | mail_pusher/utils.py | qq20004604/Mail-Report-System | 59d2390431251d8ffd0435cab510a37900f2dc17 | [
"Apache-2.0"
] | 1 | 2020-07-29T08:54:46.000Z | 2020-07-29T08:54:46.000Z | mail_pusher/utils.py | qq20004604/Mail-Report-System | 59d2390431251d8ffd0435cab510a37900f2dc17 | [
"Apache-2.0"
] | 6 | 2021-03-19T10:24:43.000Z | 2021-09-22T19:30:43.000Z | mail_pusher/utils.py | qq20004604/Mail-Report-System | 59d2390431251d8ffd0435cab510a37900f2dc17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
#
# api
# api
| 34.974684 | 98 | 0.5827 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from django.utils import timezone
from .models import RegVerifyMailModel, REG_EXPIRE_TIME
from package import mail_client
# 检查该用户当前是否可以推送验证码邮件
def can_send_regcode_email(email, ip):
# 验证规则:
# 1. 3 分钟内 1 封;
# 2. 1 小时内 5 封;
# 3. 24 小时 10 封;
# 邮箱地址 和 ip ... | 555 | 0 | 0 | 0 | 0 | 2,268 | 0 | 56 | 176 |
a5987e4eb3f12343ad9ec4c139a554828e58dc73 | 376 | py | Python | test2.py | matzegltg/miau | 89b580baccbd258fbfd81bc19b46603a07873f14 | [
"MIT"
] | null | null | null | test2.py | matzegltg/miau | 89b580baccbd258fbfd81bc19b46603a07873f14 | [
"MIT"
] | 1 | 2021-05-07T15:50:51.000Z | 2021-05-07T15:50:51.000Z | test2.py | matzegltg/miau | 89b580baccbd258fbfd81bc19b46603a07873f14 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
# Fixing random state for reproducibility
np.random.seed(19680801)
x = np.random.rand(10)
y = np.random.rand(10)
z = np.sqrt(x**2 + y**2)
fig, axs = plt.subplots(2, 3, sharex=True, sharey=True)
# marker symbol
axs[0, 0].scatter(x, y, s=80, c=z, marker=">")
axs[0, 0... | 20.888889 | 55 | 0.680851 | import numpy as np
import matplotlib.pyplot as plt
# Fixing random state for reproducibility
np.random.seed(19680801)
x = np.random.rand(10)
y = np.random.rand(10)
z = np.sqrt(x**2 + y**2)
fig, axs = plt.subplots(2, 3, sharex=True, sharey=True)
# marker symbol
axs[0, 0].scatter(x, y, s=80, c=z, marker=">")
axs[0, 0... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
739d3d099fcf65945b4820df45eb34f357bcd0c0 | 2,922 | py | Python | lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | 8 | 2019-03-18T06:37:24.000Z | 2022-01-30T07:50:58.000Z | lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | """Leetcode 714. Best Time to Buy and Sell Stock with Transaction Fee
Medium
URL: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
Your are given an array of integers prices, for which the i-th element is the price of
a given stock on day i; and a non-negative integer fee representi... | 27.566038 | 88 | 0.582478 | """Leetcode 714. Best Time to Buy and Sell Stock with Transaction Fee
Medium
URL: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
Your are given an array of integers prices, for which the i-th element is the price of
a given stock on day i; and a non-negative integer fee representi... | 0 | 0 | 0 | 1,651 | 0 | 185 | 0 | 0 | 69 |
939f46ff7b3701ea5aa26dc92a3ccf588e8d1a71 | 1,983 | py | Python | ngs_utils/ensembl/generate_cds_bed.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 3 | 2018-06-06T01:41:51.000Z | 2020-08-20T11:36:06.000Z | ngs_utils/ensembl/generate_cds_bed.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 4 | 2019-11-28T03:34:54.000Z | 2021-06-24T23:04:55.000Z | ngs_utils/ensembl/generate_cds_bed.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 5 | 2018-03-15T12:43:38.000Z | 2021-06-24T23:12:48.000Z | #!/usr/bin/env python
''' Generates coding_regions BED file
Example usage:
python {__file__} -g GRCh37 --canonical | grep -v ^MT | grep -v ^GL | sort -k1,1V -k2,2n | bedtools merge -i - > coding_regions.canonical.clean.sort.merged.bed
'''
if __name__ == '__main__':
main()
| 34.189655 | 163 | 0.658598 | #!/usr/bin/env python
import ngs_utils.ensembl as ebl
import os
import shutil
from optparse import OptionParser, SUPPRESS_HELP
from os.path import isfile, join, basename, dirname, pardir
from ngs_utils import logger
from ngs_utils.file_utils import file_transaction, adjust_path, safe_mkdir, verify_file
''' Generates... | 0 | 0 | 0 | 0 | 0 | 1,386 | 0 | 128 | 178 |
c81b5e76ee09ead4a18ea60317fb89ab05a096a3 | 1,731 | py | Python | moses/tests/test_io.py | l04m33/moses | 4106b700f46d0dae2f238a56849f3eaf8e639491 | [
"MIT"
] | 7 | 2016-03-28T09:05:11.000Z | 2021-11-26T16:05:25.000Z | moses/tests/test_io.py | l04m33/moses | 4106b700f46d0dae2f238a56849f3eaf8e639491 | [
"MIT"
] | 2 | 2017-06-30T23:33:28.000Z | 2020-04-13T14:23:55.000Z | moses/tests/test_io.py | l04m33/moses | 4106b700f46d0dae2f238a56849f3eaf8e639491 | [
"MIT"
] | 5 | 2017-05-26T12:51:59.000Z | 2020-04-13T12:33:01.000Z | import moses.io as io
| 34.62 | 79 | 0.705373 | import unittest
import asyncio
import moses.io as io
from . import dummy
class TestUDPRelayProtocol(unittest.TestCase):
def test_datagram_received(self):
writer_mock, dummy_write = dummy.make_dummy_writer()
udp_relay = io.UDPRelayProtocol(writer_mock)
udp_relay.datagram_received(b'12345678... | 0 | 0 | 0 | 1,610 | 0 | 0 | 0 | -15 | 112 |
4c4deb3a16ba837e466b59de00e7b0b355e00220 | 458 | py | Python | documentation_threading/03_thread_objects/thread_objects_03.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | documentation_threading/03_thread_objects/thread_objects_03.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | documentation_threading/03_thread_objects/thread_objects_03.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | import threading
thread_01 = threading.Thread(
# name='t1',
target=target_function,
kwargs={'person_01': 'Bruno', 'person_02': 'Hanna'})
thread_01.start()
thread_01.join()
print('executed after join thread 01')
| 18.32 | 74 | 0.70524 | import threading
def target_function(person_01: str = 'p1', person_02: str = 'p2') -> None:
print(threading.current_thread().name)
print(threading.current_thread().is_alive())
print(f'person_01: {person_01}')
print(f'person_02: {person_02}')
thread_01 = threading.Thread(
# name='t1',
target=target_func... | 0 | 0 | 0 | 0 | 0 | 211 | 0 | 0 | 23 |
56d605ffcdce16e4e693e5b85a793c74ca3a652d | 20,973 | py | Python | ml4tc/machine_learning/conv_lstm_architecture.py | NOAA-GSL/ml4tc | e9f8faa51e5bfb86b2a78648d7b1d0e61d09b6c0 | [
"MIT"
] | null | null | null | ml4tc/machine_learning/conv_lstm_architecture.py | NOAA-GSL/ml4tc | e9f8faa51e5bfb86b2a78648d7b1d0e61d09b6c0 | [
"MIT"
] | null | null | null | ml4tc/machine_learning/conv_lstm_architecture.py | NOAA-GSL/ml4tc | e9f8faa51e5bfb86b2a78648d7b1d0e61d09b6c0 | [
"MIT"
] | null | null | null | """Methods for building convolutional LSTM."""
import numpy
import keras
from gewittergefahr.gg_utils import error_checking
from gewittergefahr.deep_learning import architecture_utils
from ml4tc.machine_learning import cnn_architecture
INPUT_DIMENSIONS_KEY = 'input_dimensions'
NUM_LAYERS_BY_BLOCK_KEY = 'num_layers_by... | 42.114458 | 80 | 0.739951 | """Methods for building convolutional LSTM."""
import numpy
import keras
from gewittergefahr.gg_utils import error_checking
from gewittergefahr.deep_learning import architecture_utils
from ml4tc.machine_learning import cnn_architecture
INPUT_DIMENSIONS_KEY = 'input_dimensions'
NUM_LAYERS_BY_BLOCK_KEY = 'num_layers_by... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
68ce8e521626b0dd2dab0d6ea9e39e26675d3f03 | 13,805 | py | Python | simulator/static/python/rbatools/rba/core/species.py | tlubitz/rba | 073b591ff6047ee8df00288ecfe45094e2b7d195 | [
"MIT"
] | null | null | null | simulator/static/python/rbatools/rba/core/species.py | tlubitz/rba | 073b591ff6047ee8df00288ecfe45094e2b7d195 | [
"MIT"
] | null | null | null | simulator/static/python/rbatools/rba/core/species.py | tlubitz/rba | 073b591ff6047ee8df00288ecfe45094e2b7d195 | [
"MIT"
] | null | null | null | """Module defining Machinery, Species and ProcessingMap classes."""
# python 2/3 compatibility
from __future__ import division, print_function, absolute_import
# global imports
from collections import namedtuple
from scipy.sparse import (hstack)
# class storing machinery-related information
Machinery = namedtuple('M... | 42.608025 | 79 | 0.638899 | """Module defining Machinery, Species and ProcessingMap classes."""
# python 2/3 compatibility
from __future__ import division, print_function, absolute_import
# global imports
from collections import namedtuple
from scipy.sparse import (
csr_matrix, csc_matrix, lil_matrix, coo_matrix, hstack, eye
)
import nu... | 0 | 0 | 0 | 11,346 | 0 | 0 | 0 | 54 | 91 |
db6eeb0cb0b20da09112cc105a0ad05e4ea8a592 | 1,748 | py | Python | mediagoblin/plugins/processing_info/__init__.py | gnu-mirror-unofficial/mediagoblin | 522a61b24a1b7767682eaf7b29c59e40a0a9b73f | [
"CC0-1.0"
] | 1 | 2021-09-21T02:24:43.000Z | 2021-09-21T02:24:43.000Z | mediagoblin/plugins/processing_info/__init__.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | null | null | null | mediagoblin/plugins/processing_info/__init__.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | 1 | 2021-09-21T02:25:20.000Z | 2021-09-21T02:25:20.000Z | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 33.615385 | 77 | 0.730549 | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 0 | 0 | 0 | 0 | 0 | 591 | 0 | 70 | 113 |
ca0fadae775f849a2b0ae902e75b518832fc9702 | 12,335 | py | Python | photometry/src/calc_zptmag_apparent_mags_hierarchical_ILAPHv5.py | gnarayan/WDdata | 010edd14c9bd6bef1e52734b1b784354049a3573 | [
"MIT"
] | 3 | 2018-12-03T20:03:19.000Z | 2022-01-14T19:47:44.000Z | photometry/src/calc_zptmag_apparent_mags_hierarchical_ILAPHv5.py | gnarayan/WDdata | 010edd14c9bd6bef1e52734b1b784354049a3573 | [
"MIT"
] | null | null | null | photometry/src/calc_zptmag_apparent_mags_hierarchical_ILAPHv5.py | gnarayan/WDdata | 010edd14c9bd6bef1e52734b1b784354049a3573 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
if __name__=='__main__':
sys.exit(main())
| 42.098976 | 166 | 0.597081 | #!/usr/bin/env python
import sys
import os
import glob
import numpy as np
from astropy.io import ascii
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import astropy.table as at
from numpy.lib.recfunctions import append_fields
from scipy.stats import linregress
import pymc3 as pm
im... | 0 | 0 | 0 | 0 | 0 | 11,883 | 0 | 77 | 287 |
039e1504f90367655a81f68f749b287b053ec962 | 489 | py | Python | pacman-termux/test/pacman/tests/skip-remove-with-glob-chars.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/skip-remove-with-glob-chars.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/skip-remove-with-glob-chars.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "transferred file with glob characters that match a removed file"
lp = pmpkg("foo")
lp.files = ["foo/b*r", "foo/bar"]
self.addpkg2db("local", lp)
sp1 = pmpkg("foo", "1.0-2")
self.addpkg(sp1)
sp2 = pmpkg("bar", "1.0-2")
sp2.files = ["foo/b*r"]
self.addpkg(sp2)
self.args = "-U %s %s" % (sp1.filenam... | 24.45 | 84 | 0.666667 | self.description = "transferred file with glob characters that match a removed file"
lp = pmpkg("foo")
lp.files = ["foo/b*r", "foo/bar"]
self.addpkg2db("local", lp)
sp1 = pmpkg("foo", "1.0-2")
self.addpkg(sp1)
sp2 = pmpkg("bar", "1.0-2")
sp2.files = ["foo/b*r"]
self.addpkg(sp2)
self.args = "-U %s %s" % (sp1.filenam... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
933a2b06638629c8b915c8d5b2a03a2db983bef3 | 5,478 | py | Python | minent/utils.py | DistrictDataLabs/minimum-entropy | f27f0bf5d01e122fda76e3cb27bbe4b36f3e782a | [
"Apache-2.0"
] | 14 | 2016-12-28T05:56:38.000Z | 2021-04-11T00:12:16.000Z | minent/utils.py | DistrictDataLabs/minimum-entropy | f27f0bf5d01e122fda76e3cb27bbe4b36f3e782a | [
"Apache-2.0"
] | 32 | 2016-07-05T18:44:46.000Z | 2016-08-15T14:46:36.000Z | minent/utils.py | DistrictDataLabs/minimum-entropy | f27f0bf5d01e122fda76e3cb27bbe4b36f3e782a | [
"Apache-2.0"
] | 4 | 2016-08-09T20:52:13.000Z | 2020-03-04T00:38:27.000Z | # minent.utils
# Project level utilities
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Oct 23 14:09:04 2014 -0400
#
# Copyright (C) 2014 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: utils.py [24fa113] benjamin@bengfort.com $
"""
Project level utilities
"""
################... | 30.433333 | 105 | 0.563709 | # minent.utils
# Project level utilities
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Oct 23 14:09:04 2014 -0400
#
# Copyright (C) 2014 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: utils.py [24fa113] benjamin@bengfort.com $
"""
Project level utilities
"""
################... | 0 | 377 | 0 | 783 | 0 | 0 | 0 | -4 | 121 |
895352ff3c2cb5e76abd6f31c9fad037fd0ea75c | 40 | py | Python | tests/exceptions/valid_package/x.py | kogut/statick | 6cbe43b5ac78275a12af3ac5aa325833368d0767 | [
"CC0-1.0"
] | 54 | 2018-08-27T19:12:41.000Z | 2022-03-31T04:16:40.000Z | tests/exceptions/valid_package/x.py | gregtkogut/statick | 11a8f950d50b52903a25f4f00c7cd52a90eff56c | [
"CC0-1.0"
] | 288 | 2018-08-28T13:17:44.000Z | 2022-03-21T20:05:19.000Z | tests/exceptions/valid_package/x.py | gregtkogut/statick | 11a8f950d50b52903a25f4f00c7cd52a90eff56c | [
"CC0-1.0"
] | 12 | 2018-08-28T13:18:39.000Z | 2022-03-21T19:27:16.000Z | #!/usr/bin/env python3
x = 0 # NOLINT
| 10 | 22 | 0.6 | #!/usr/bin/env python3
x = 0 # NOLINT
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4b3ceb15c0b6205d9c1a1fcb70a1080c830c83b | 5,881 | py | Python | experiments/examples/riemann_linear_regression/plot_coreset_pts.py | DominicBroadbentCompass/bayesian-coresets-optimization | 3657f2ebfc4f0e6b36f5c651b0651f06d7e3d6b1 | [
"MIT"
] | 5 | 2021-05-21T02:34:17.000Z | 2022-03-29T15:17:26.000Z | experiments/examples/riemann_linear_regression/plot_coreset_pts.py | DominicBroadbentCompass/bayesian-coresets-optimization | 3657f2ebfc4f0e6b36f5c651b0651f06d7e3d6b1 | [
"MIT"
] | 2 | 2021-03-12T04:07:52.000Z | 2021-03-15T12:56:05.000Z | experiments/examples/riemann_linear_regression/plot_coreset_pts.py | DominicBroadbentCompass/bayesian-coresets-optimization | 3657f2ebfc4f0e6b36f5c651b0651f06d7e3d6b1 | [
"MIT"
] | 4 | 2020-06-23T04:51:43.000Z | 2021-02-04T15:07:41.000Z | import os
import sys
import bokeh.plotting as bkp
import numpy as np
from bokeh.models import Label
from bokeh.io import export_svgs
import cairosvg
# make it so we can import models/etc from parent folder
sys.path.insert(1, os.path.join(sys.path[0], '../common'))
from skimage import measure
print('Loading data')
x =... | 40.840278 | 123 | 0.584084 | import os
import sys
import bokeh.layouts as bkl
import bokeh.plotting as bkp
import numpy as np
from bokeh.models import Label
from bokeh.io import export_svgs
import cairosvg
# make it so we can import models/etc from parent folder
sys.path.insert(1, os.path.join(sys.path[0], '../common'))
from plotting import *
fr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 45 |
6ae3c0d5905afeaf1197370765846d90cf8945df | 9,129 | py | Python | lib/cleanupSupport.py | bbockelm/glideinWMS | a2b39e3d4ff6c4527efad54b1eefe728a4ec9d18 | [
"BSD-3-Clause"
] | null | null | null | lib/cleanupSupport.py | bbockelm/glideinWMS | a2b39e3d4ff6c4527efad54b1eefe728a4ec9d18 | [
"BSD-3-Clause"
] | 3 | 2015-12-02T19:37:45.000Z | 2016-01-20T03:21:48.000Z | lib/cleanupSupport.py | bbockelm/glideinWMS | a2b39e3d4ff6c4527efad54b1eefe728a4ec9d18 | [
"BSD-3-Clause"
] | 1 | 2015-12-01T23:02:41.000Z | 2015-12-01T23:02:41.000Z | import os
import pwd
MY_USERNAME = pwd.getpwuid(os.getuid())[0]
cleaners = Cleanup()
cred_cleaners = CredCleanup()
# this class is used for cleanup
# this class is used for cleanup
| 37.261224 | 126 | 0.588235 | import os
import stat
import time
import re
import pwd
import logSupport
import condorPrivsep
from pidSupport import register_sighandler, unregister_sighandler
MY_USERNAME = pwd.getpwuid(os.getuid())[0]
class Cleanup:
def __init__(self):
self.cleanup_objects = []
self.cleanup_pids = []
def ad... | 0 | 0 | 0 | 8,655 | 0 | 0 | 0 | 7 | 268 |
4754aeac6a9b31ae57ba8abcec4a83579918f56e | 528 | py | Python | scripts/cleanUnAnnotated.py | HaseloffLab/MarpoDB | 40a15f4ce828e3e51b5d58527fa6f7f6f1a61bff | [
"MIT"
] | 3 | 2020-11-23T21:50:04.000Z | 2022-01-16T18:20:46.000Z | scripts/cleanUnAnnotated.py | HaseloffLab/MarpoDB | 40a15f4ce828e3e51b5d58527fa6f7f6f1a61bff | [
"MIT"
] | 4 | 2021-03-18T20:23:44.000Z | 2022-01-13T00:41:16.000Z | scripts/cleanUnAnnotated.py | HaseloffLab/MarpoDB | 40a15f4ce828e3e51b5d58527fa6f7f6f1a61bff | [
"MIT"
] | 2 | 2017-05-21T16:42:23.000Z | 2018-06-14T00:10:48.000Z | import sys
from partsdb.partsdb import PartsDB
marpodb = PartsDB('postgresql:///'+sys.argv[1], Base = Base)
session = marpodb.Session()
n=0
i=0
for gene in session.query(Gene).all():
n = session.query(InterProHit).filter(InterProHit.targetID == gene.cds.id).count()
if n == 0:
session.query(BlastpHit).filter(B... | 20.307692 | 83 | 0.685606 | import sys
from partsdb.partsdb import PartsDB
from tables import *
marpodb = PartsDB('postgresql:///'+sys.argv[1], Base = Base)
session = marpodb.Session()
n=0
i=0
for gene in session.query(Gene).all():
n = session.query(InterProHit).filter(InterProHit.targetID == gene.cds.id).count()
if n == 0:
session.quer... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
95eb658a498b918d220df247f0463420f88fca34 | 675 | py | Python | test/hummingbot/client/config/test_config_validators.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | 11 | 2020-09-15T08:21:59.000Z | 2022-03-19T05:06:59.000Z | test/hummingbot/client/config/test_config_validators.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | null | null | null | test/hummingbot/client/config/test_config_validators.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | 5 | 2020-09-18T12:59:31.000Z | 2021-06-27T01:46:16.000Z |
import hummingbot.client.config.config_validators as config_validators
| 39.705882 | 106 | 0.797037 | from unittest import TestCase
import hummingbot.client.config.config_validators as config_validators
class TimestampValidationTests(TestCase):
def test_validation_does_not_fail_with_valid_timestamp_string(self):
timestamp_string = "2021-06-23 10:15:20"
self.assertIsNone(config_validators.valida... | 0 | 0 | 0 | 549 | 0 | 0 | 0 | 8 | 45 |
8b3e8fde236a85c41a3d04001f6078e679ef57fc | 2,314 | py | Python | lib/compile_servers.py | suzuki-shunsuke/ansible-playbook-example | 1efaabee03669cf2a5643a4906836057137ae85b | [
"MIT"
] | 1 | 2022-02-09T06:36:02.000Z | 2022-02-09T06:36:02.000Z | lib/compile_servers.py | suzuki-shunsuke/ansible-playbook-example | 1efaabee03669cf2a5643a4906836057137ae85b | [
"MIT"
] | null | null | null | lib/compile_servers.py | suzuki-shunsuke/ansible-playbook-example | 1efaabee03669cf2a5643a4906836057137ae85b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 34.029412 | 71 | 0.556612 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
class Compiler(object):
def get_sshcfg_str(self, **kwargs):
return "\n".join([
"Host {type}-{idx}.{env}",
" HostName {ip}",
" User {user}",
" IdentityFile ssh-keys/{type}.{env}",
... | 0 | 0 | 0 | 2,220 | 0 | 0 | 0 | -22 | 69 |
4bf3a19ec98cd43f5e688d4048420b5d072f0d8e | 2,068 | py | Python | object_detection/utils/test_utils_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | 1 | 2019-09-19T18:24:55.000Z | 2019-09-19T18:24:55.000Z | object_detection/utils/test_utils_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | null | null | null | object_detection/utils/test_utils_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Travis Yates
"""Tests for object_detection.utils.test_utils."""
import tensorflow as tf
if __name__ == '__main__':
tf.test.main()
| 32.825397 | 71 | 0.488395 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Travis Yates
"""Tests for object_detection.utils.test_utils."""
import numpy as np
import tensorflow as tf
from object_detection.utils import test_utils
class TestUtilsTest(tf.test.TestCase):
def test_diagonal_gradient_image(self):
"""Tests i... | 0 | 0 | 0 | 1,776 | 0 | 0 | 0 | 21 | 69 |
b771ad0f895c2b37b349d102fe8f76c44e0a9eeb | 114 | py | Python | demo.py | Arui66/FPSAutomaticAiming | 87674385d42b065b984b38a2ff59e7f2d4f07dc9 | [
"Apache-2.0"
] | 129 | 2021-09-01T19:27:31.000Z | 2022-03-31T07:50:34.000Z | demo.py | Arui66/FPSAutomaticAiming | 87674385d42b065b984b38a2ff59e7f2d4f07dc9 | [
"Apache-2.0"
] | 19 | 2021-09-06T06:55:49.000Z | 2022-03-30T10:16:19.000Z | demo.py | Arui66/FPSAutomaticAiming | 87674385d42b065b984b38a2ff59e7f2d4f07dc9 | [
"Apache-2.0"
] | 50 | 2021-09-04T11:41:37.000Z | 2022-03-30T15:18:01.000Z | import keyboard
keyboard.hook(abc)
keyboard.wait()
| 10.363636 | 29 | 0.605263 | import keyboard
def abc(x):
if x.name == 'caps lock':
print(x)
keyboard.hook(abc)
keyboard.wait()
| 0 | 0 | 0 | 0 | 0 | 37 | 0 | 0 | 23 |
26c53a3b827de8fe9c3a7cabaad1103103b8ffe9 | 3,791 | py | Python | subcommands/consolidate_data.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | 2 | 2019-11-18T18:01:27.000Z | 2021-05-13T18:16:17.000Z | subcommands/consolidate_data.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | null | null | null | subcommands/consolidate_data.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | 3 | 2019-07-18T19:33:04.000Z | 2021-01-13T21:13:29.000Z | """Consolidate repository data from several previous steps.
Use -h or --help for more information.
"""
import argparse
import csv
import logging
import sys
from util.parse import parse_repo_to_package_file, consolidate_data
__log__ = logging.getLogger(__name__)
FIELDNAMES = [
'id',
'name',
'full_name',... | 32.681034 | 79 | 0.660248 | """Consolidate repository data from several previous steps.
Use -h or --help for more information.
"""
import argparse
import csv
import logging
import sys
from util.parse import \
parse_repo_to_package_file, \
consolidate_data
__log__ = logging.getLogger(__name__)
FIELDNAMES = [
'id',
'name',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 0 |
c72e662d53852fd2bde3391d495db630ad9e60ef | 677 | py | Python | tests/pubmed/package1/test_example_mod2.py | toritori1000/pubmedrepo | cc81871bb7a2abd3209d99863cf31872b1d0798c | [
"MIT"
] | null | null | null | tests/pubmed/package1/test_example_mod2.py | toritori1000/pubmedrepo | cc81871bb7a2abd3209d99863cf31872b1d0798c | [
"MIT"
] | null | null | null | tests/pubmed/package1/test_example_mod2.py | toritori1000/pubmedrepo | cc81871bb7a2abd3209d99863cf31872b1d0798c | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
# Run tests with the warning such as below ignored (not shown).
# InsecureRequestWarning: Unverified HTTPS request
# ResourceWarning: unclosed <ssl.SSLSocket fd=5, ...
unittest.main(warnings='ignore')
| 21.15625 | 67 | 0.670606 | import unittest
from pubmed.package1.example_mod2 import ExampleMod2
class ExampleModTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass
@classmethod
def tearDownClass(cls):
pass
def setUp(self):
pass
def tearDown(self):
pass
def test_examp... | 0 | 61 | 0 | 276 | 0 | 0 | 0 | 31 | 46 |
fce02a6f176f615eb2ab37324b654bce65ed48c8 | 449 | py | Python | Python Code/basicPython.py | Joshrogan/Python | 48a4fee328c60bc7a937e1e0b16485523d89cfd7 | [
"MIT"
] | 1 | 2019-11-19T19:40:10.000Z | 2019-11-19T19:40:10.000Z | Python Code/basicPython.py | Joshrogan/Python | 48a4fee328c60bc7a937e1e0b16485523d89cfd7 | [
"MIT"
] | 1 | 2019-11-26T19:39:58.000Z | 2019-11-26T19:39:58.000Z | Python Code/basicPython.py | Joshrogan/Python | 48a4fee328c60bc7a937e1e0b16485523d89cfd7 | [
"MIT"
] | 1 | 2019-11-26T19:39:11.000Z | 2019-11-26T19:39:11.000Z | # The following code is of week one of python
print("Hello my name is George!")
print("This is my dog Max!")
print('o----')
print(' ||||')
# some maths!
print(50 - 10)
# let's make a variable for year I was born in by inputting!
# make sure to click on the black screen to type an press enter!
year = input("What year... | 28.0625 | 83 | 0.685969 | # The following code is of week one of python
print("Hello my name is George!")
print("This is my dog Max!")
print('o----')
print(' ||||')
# some maths!
print(50 - 10)
# let's make a variable for year I was born in by inputting!
# make sure to click on the black screen to type an press enter!
year = input("What year... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4ddc6c328ceb1612d72a6ac1c529289d0fe46b7e | 376 | py | Python | wordcount.py | phamvanhanh6720/Bigdata | 5310fc3ce5b1b21341489df89cb76be0a5a09020 | [
"MIT"
] | 2 | 2022-01-01T15:27:51.000Z | 2022-01-03T15:00:49.000Z | wordcount.py | phamvanhanh6720/Bigdata | 5310fc3ce5b1b21341489df89cb76be0a5a09020 | [
"MIT"
] | null | null | null | wordcount.py | phamvanhanh6720/Bigdata | 5310fc3ce5b1b21341489df89cb76be0a5a09020 | [
"MIT"
] | 1 | 2022-02-13T02:40:21.000Z | 2022-02-13T02:40:21.000Z | import sys
from pyspark import SparkContext
sc = SparkContext(appName="WordCountExample")
lines = sc.textFile(sys.argv[1])
counts = lines.flatMap(lambda x: x.split(' ')) \
.map(lambda x: (x, 1)) \
.reduceByKey(lambda x, y: x+y)
output = counts.collect()
for (word, count) in o... | 31.333333 | 49 | 0.593085 | import sys
from pyspark import SparkContext
sc = SparkContext(appName="WordCountExample")
lines = sc.textFile(sys.argv[1])
counts = lines.flatMap(lambda x: x.split(' ')) \
.map(lambda x: (x, 1)) \
.reduceByKey(lambda x, y: x+y)
output = counts.collect()
for (word, count) in o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d32952302b91522d6b6545acd1efb885c7259b9c | 1,968 | py | Python | azext_iot/sdk/pnp/dataplane/models/model_search_options_py3.py | srinivasaraogattupalli/azure-iot-cli-extension | 9885dd528fe363f5c118f3b735ad22fd4e1a86f4 | [
"MIT"
] | null | null | null | azext_iot/sdk/pnp/dataplane/models/model_search_options_py3.py | srinivasaraogattupalli/azure-iot-cli-extension | 9885dd528fe363f5c118f3b735ad22fd4e1a86f4 | [
"MIT"
] | null | null | null | azext_iot/sdk/pnp/dataplane/models/model_search_options_py3.py | srinivasaraogattupalli/azure-iot-cli-extension | 9885dd528fe363f5c118f3b735ad22fd4e1a86f4 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 41 | 151 | 0.629573 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 0 | 0 | 0 | 1,431 | 0 | 0 | 0 | 17 | 46 |
a2196d0f7780a7b4bed211a4ace46aa572a79d85 | 6,286 | py | Python | interractive.py | olom70/map | 4ae5279f401dbe9ac06d8000713579a12dc7561a | [
"CC0-1.0"
] | null | null | null | interractive.py | olom70/map | 4ae5279f401dbe9ac06d8000713579a12dc7561a | [
"CC0-1.0"
] | null | null | null | interractive.py | olom70/map | 4ae5279f401dbe9ac06d8000713579a12dc7561a | [
"CC0-1.0"
] | null | null | null | #%%
import configparser
config = configparser.ConfigParser()
config.read('map_indicators.ini')
config.sections()
tables = config['Database']['tables'].split()
print(tables)
# %%
import configparser
def init(inifile : str) -> bool:
'''
check if everything is ok prior to entering the main loop
'''
c... | 26.635593 | 104 | 0.635539 | #%%
import configparser
config = configparser.ConfigParser()
config.read('map_indicators.ini')
config.sections()
tables = config['Database']['tables'].split()
print(tables)
# %%
import configparser
def init(inifile : str) -> bool:
'''
check if everything is ok prior to entering the main loop
'''
c... | 21 | 426 | 0 | 0 | 0 | 2,653 | 0 | 28 | 315 |
b0dda212206426046b9871d8c294638c1d4846e8 | 779 | py | Python | orphanet/join_xml_sources.py | MRCIEU/mendelvar_standalone | fcde92fc012aa9dae7e7674b23387219921cadc9 | [
"MIT"
] | 3 | 2021-04-01T01:59:02.000Z | 2021-07-28T15:05:36.000Z | orphanet/join_xml_sources.py | MRCIEU/mendelvar_standalone | fcde92fc012aa9dae7e7674b23387219921cadc9 | [
"MIT"
] | null | null | null | orphanet/join_xml_sources.py | MRCIEU/mendelvar_standalone | fcde92fc012aa9dae7e7674b23387219921cadc9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import pandas as pd
#Full outer join on the 3 tables produced based on the 3 XML Orphanet files.
filename1 = "orphanet_xml1_parsed"
filename4 = "orphanet_xml4_parsed"
filename6 = "orphanet_xml6_parsed"
f1_df = pd.read_csv(filename1, sep="\t", index_col=False, dtype=str, na_filter = False, encoding... | 51.933333 | 105 | 0.741977 | #!/usr/bin/env python
import pandas as pd
#Full outer join on the 3 tables produced based on the 3 XML Orphanet files.
filename1 = "orphanet_xml1_parsed"
filename4 = "orphanet_xml4_parsed"
filename6 = "orphanet_xml6_parsed"
f1_df = pd.read_csv(filename1, sep="\t", index_col=False, dtype=str, na_filter = False, encoding... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16a145283dfcd7cfb3244c5f692e7ecaba970b3f | 446 | py | Python | examples/discord_simple.py | NextChai/Tixte | 8b91c3e9e26abda20891e81399af81e00beb985e | [
"MIT"
] | 1 | 2021-08-05T05:25:36.000Z | 2021-08-05T05:25:36.000Z | examples/discord_simple.py | NextChai/Tixte | 8b91c3e9e26abda20891e81399af81e00beb985e | [
"MIT"
] | null | null | null | examples/discord_simple.py | NextChai/Tixte | 8b91c3e9e26abda20891e81399af81e00beb985e | [
"MIT"
] | null | null | null | import tixte
import discord
client = discord.Client(intents=discord.Intents.all(), command_prefix='!')
client.tixte = tixte.Client('your-master-token') | 37.166667 | 74 | 0.715247 | import tixte
import discord
client = discord.Client(intents=discord.Intents.all(), command_prefix='!')
client.tixte = tixte.Client('your-master-token')
@client.event
async def on_member_join(member):
if member.id == 146348630926819328: # Specific user
file = discord.File("my_image.png")
url = awa... | 0 | 271 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
98e7a9b5456fd1c3d1b56c245f45739fcabe6f84 | 1,651 | py | Python | pyscreenshot/plugins/wxscreen.py | robocorp/pyscreenshot | 7cf03b23f4bdf1e4a2e3df1893de598e852dd346 | [
"BSD-2-Clause"
] | 1 | 2021-03-17T17:02:28.000Z | 2021-03-17T17:02:28.000Z | pyscreenshot/plugins/wxscreen.py | robocorp/rpaframework-screenshot | 7cf03b23f4bdf1e4a2e3df1893de598e852dd346 | [
"BSD-2-Clause"
] | null | null | null | pyscreenshot/plugins/wxscreen.py | robocorp/rpaframework-screenshot | 7cf03b23f4bdf1e4a2e3df1893de598e852dd346 | [
"BSD-2-Clause"
] | null | null | null | import logging
from pyscreenshot.util import py2
if py2():
to_bytes = buffer
else:
to_bytes = bytes
log = logging.getLogger(__name__)
# based on:
# http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-script-linux
app = None
| 23.927536 | 86 | 0.583283 | import logging
from PIL import Image
from pyscreenshot.plugins.backend import CBackend
from pyscreenshot.util import platform_is_osx, py2
if py2():
to_bytes = buffer
else:
to_bytes = bytes
log = logging.getLogger(__name__)
# based on:
# http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-... | 0 | 0 | 0 | 1,257 | 0 | 0 | 0 | 45 | 91 |
aa75d306658a5a58ed88b755444ad851dc7528d4 | 807 | py | Python | ltapysg/bus.py | Codestian/ltapy | 73dc1624d144e7b3d0e15621dabb204654174ead | [
"MIT"
] | 1 | 2021-07-23T21:44:08.000Z | 2021-07-23T21:44:08.000Z | ltapysg/bus.py | Codestian/ltapysg | 73dc1624d144e7b3d0e15621dabb204654174ead | [
"MIT"
] | null | null | null | ltapysg/bus.py | Codestian/ltapysg | 73dc1624d144e7b3d0e15621dabb204654174ead | [
"MIT"
] | null | null | null |
# Retrieve arrival timings for all buses operating for specified bus stop. Each bus has 3 recurring timings.
# Retrieve data of all operating bus services.
# Retrieve data of all operating bus routes.
# Retrieve data of bus stops. Max number of records per page is 500.
| 32.28 | 108 | 0.733581 | from .api import call
# Retrieve arrival timings for all buses operating for specified bus stop. Each bus has 3 recurring timings.
async def get_bus_arrival(api_key, bus_stop_code):
data = await call(api_key, "BusArrivalv2?BusStopCode=" + str(bus_stop_code))
return data["Services"]
# Retrieve data of all ope... | 0 | 0 | 420 | 0 | 0 | 0 | 0 | 0 | 110 |
35e9a17669a701d342e2843ef03d2d4370c7db2f | 11,720 | py | Python | malort/tests/test_malort_stats.py | CamDavidsonPilon/malort | bd463fe57fd7a15ccd24a1c7cfedefea4b31d3ac | [
"MIT"
] | 1 | 2021-03-06T13:17:33.000Z | 2021-03-06T13:17:33.000Z | malort/tests/test_malort_stats.py | CamDavidsonPilon/malort | bd463fe57fd7a15ccd24a1c7cfedefea4b31d3ac | [
"MIT"
] | null | null | null | malort/tests/test_malort_stats.py | CamDavidsonPilon/malort | bd463fe57fd7a15ccd24a1c7cfedefea4b31d3ac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Malort Tests
Test Runner: PyTest
Notes:
* Expected values for string samples are any values that the sample
could contain, not the exact values.
"""
| 42.773723 | 79 | 0.355546 | # -*- coding: utf-8 -*-
"""
Malort Tests
Test Runner: PyTest
Notes:
* Expected values for string samples are any values that the sample
could contain, not the exact values.
"""
import os
import unittest
import pytest
import malort as mt
from malort.test_helpers import TestHelpers, TEST_FILES_1, TEST_FILES_2
clas... | 0 | 3,255 | 0 | 8,079 | 0 | 0 | 0 | 22 | 181 |
fa6cb68e7f76699a4fda284654ae386e6c7bc077 | 14,401 | py | Python | stabilizer_code.py | shubhamchandak94/stabilizer_code | 327a748befa79102e8aaa1f14d828065e7b3b8f0 | [
"MIT"
] | 3 | 2019-10-02T12:51:54.000Z | 2021-12-15T06:02:00.000Z | stabilizer_code.py | manhduc1811/stabilizer_code | 327a748befa79102e8aaa1f14d828065e7b3b8f0 | [
"MIT"
] | null | null | null | stabilizer_code.py | manhduc1811/stabilizer_code | 327a748befa79102e8aaa1f14d828065e7b3b8f0 | [
"MIT"
] | 3 | 2020-01-08T23:16:29.000Z | 2021-02-12T16:17:34.000Z |
# all references are to chapter 4 of Gottesman's thesis, chapter 4
# https://arxiv.org/pdf/quant-ph/9705052.pdf
tuple2pauli = {(0,0):'I', (0,1): 'Z', (1,0): 'X', (1,1): 'Y'}
| 45.572785 | 169 | 0.568711 | import numpy as np
import itertools
from pyquil import Program
from pyquil.gates import MEASURE
# all references are to chapter 4 of Gottesman's thesis, chapter 4
# https://arxiv.org/pdf/quant-ph/9705052.pdf
tuple2pauli = {(0,0):'I', (0,1): 'Z', (1,0): 'X', (1,1): 'Y'}
def pauli2controlledpauli(pauli,i,j):
p = P... | 0 | 0 | 0 | 8,120 | 0 | 5,824 | 0 | 8 | 272 |
87ae92510405ce5640b6b5cd5bd551000dc5eb08 | 4,238 | py | Python | SearchAndExtractFromGDoc.py | pmanandhar1452/GoogleDocumentSearchExtract | e4e513fb7ed5798c06a5e7de9e7b80437f87757f | [
"MIT"
] | null | null | null | SearchAndExtractFromGDoc.py | pmanandhar1452/GoogleDocumentSearchExtract | e4e513fb7ed5798c06a5e7de9e7b80437f87757f | [
"MIT"
] | null | null | null | SearchAndExtractFromGDoc.py | pmanandhar1452/GoogleDocumentSearchExtract | e4e513fb7ed5798c06a5e7de9e7b80437f87757f | [
"MIT"
] | null | null | null | __author__ = "Prakash Manandhar"
__copyright__ = "Copyright 2021, Prakash Manandhar"
__credits__ = ["Prakash Manandhar"]
__license__ = "MIT"
__version__ = "1.1"
__maintainer__ = "Prakash Manandhar"
__email__ = "prakashm@alum.mit.edu"
__status__ = "Production"
import os.path
from googleapiclient.discovery import build
f... | 36.534483 | 97 | 0.660453 | __author__ = "Prakash Manandhar"
__copyright__ = "Copyright 2021, Prakash Manandhar"
__credits__ = ["Prakash Manandhar"]
__license__ = "MIT"
__version__ = "1.1"
__maintainer__ = "Prakash Manandhar"
__email__ = "prakashm@alum.mit.edu"
__status__ = "Production"
import argparse
import re
import os.path
from googleapiclie... | 0 | 0 | 0 | 0 | 0 | 777 | 0 | -18 | 91 |
01ec477fe7a14ef6903a2d62b4d67db5df21d50b | 1,778 | py | Python | load_behavioural_results_ctl.py | MadsJensen/agency_connectivity | b45adbc133573de1ebdcff0edb17e43f1691c577 | [
"BSD-3-Clause"
] | null | null | null | load_behavioural_results_ctl.py | MadsJensen/agency_connectivity | b45adbc133573de1ebdcff0edb17e43f1691c577 | [
"BSD-3-Clause"
] | null | null | null | load_behavioural_results_ctl.py | MadsJensen/agency_connectivity | b45adbc133573de1ebdcff0edb17e43f1691c577 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 27 13:53:50 2016
@author: au194693
"""
import numpy as np
import scipy.io as sio
import pandas as pd
from my_settings import (tf_folder, subjects_ctl)
data = sio.loadmat("/Volumes/My_Passport/agency_connectivity/" +
"results/data_all_Ctrl.mat")["data... | 30.135593 | 78 | 0.545557 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 27 13:53:50 2016
@author: au194693
"""
import numpy as np
import scipy.io as sio
import pandas as pd
from my_settings import (tf_folder, subjects_ctl)
data = sio.loadmat("/Volumes/My_Passport/agency_connectivity/" +
"results/data_all_Ctrl.mat")["data... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6e87fe71c011822c624797f44b1afda5a4a3adf6 | 94 | py | Python | lambdata_jayadamo/__init__.py | JayAdamo/lambdata | 655e12b4fc0db0d9947dfcbd54981252525579f3 | [
"MIT"
] | null | null | null | lambdata_jayadamo/__init__.py | JayAdamo/lambdata | 655e12b4fc0db0d9947dfcbd54981252525579f3 | [
"MIT"
] | null | null | null | lambdata_jayadamo/__init__.py | JayAdamo/lambdata | 655e12b4fc0db0d9947dfcbd54981252525579f3 | [
"MIT"
] | 1 | 2020-08-05T01:58:58.000Z | 2020-08-05T01:58:58.000Z | #!/usr/bin/env python
"""
lambdata - a collection of Data Science helper functions
"""
| 9.4 | 57 | 0.659574 | #!/usr/bin/env python
"""
lambdata - a collection of Data Science helper functions
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
489c927abbaf24f9fd6cd54bebaf466d20351095 | 4,469 | py | Python | search/info/modules/search_content/views.py | aircov/- | 2e306b846dcdd3c57f1dba4493dc3d2babb036a7 | [
"Apache-2.0"
] | null | null | null | search/info/modules/search_content/views.py | aircov/- | 2e306b846dcdd3c57f1dba4493dc3d2babb036a7 | [
"Apache-2.0"
] | null | null | null | search/info/modules/search_content/views.py | aircov/- | 2e306b846dcdd3c57f1dba4493dc3d2babb036a7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@time : 2020/05/10 12:14
@author :
"""
TREE = None
| 29.019481 | 116 | 0.626762 | # -*- coding: utf-8 -*-
"""
@time : 2020/05/10 12:14
@author : 姚明伟
"""
import json
import pickle
from flask import request, jsonify, make_response
from info.modules.search_content.search_script_conf import get_tips_word
from info.utils.content import search_content_indistinct, search_content_exact
from info.utils.... | 579 | 3,465 | 0 | 0 | 0 | 226 | 0 | 182 | 316 |
4537802d0067de55f96a213b04144019b31ab30e | 14,258 | py | Python | python-watcher-2.0.0/watcher/tests/objects/test_audit.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | python-watcher-2.0.0/watcher/tests/objects/test_audit.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | python-watcher-2.0.0/watcher/tests/objects/test_audit.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 43.736196 | 79 | 0.677304 | # Copyright 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 0 | 9,476 | 0 | 3,686 | 0 | 0 | 0 | 122 | 336 |
1b407c21fd2b5a9d6d5fed1674df3508e49d5520 | 8,081 | py | Python | export_onnx.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | 1 | 2021-04-30T07:46:32.000Z | 2021-04-30T07:46:32.000Z | export_onnx.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | null | null | null | export_onnx.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | 1 | 2022-01-21T17:31:46.000Z | 2022-01-21T17:31:46.000Z | #based on https://github.com/ducha-aiki/ucn-pytorch/blob/master/Utils.py ; commit de5bdec from Oct 4, 2017
#optimized uint8 HWC BGR -> float 1CHW directly in CUDA/pytorch code
if __name__ == "__main__":
sys.exit(main_export_onnx(sys.argv[1:]))
| 46.442529 | 207 | 0.667368 | import os
import torch
import torch.nn.functional as F
from collections import OrderedDict
import argparse
from ptsemseg.models import get_model
from ptsemseg.utils import convert_state_dict
import numpy as np
#based on https://github.com/ducha-aiki/ucn-pytorch/blob/master/Utils.py ; commit de5bdec from Oct 4, 20... | 0 | 0 | 0 | 3,595 | 0 | 3,802 | 0 | 34 | 399 |
de125dd185d4c85d699be3dfe4cdafc8237403b3 | 3,831 | py | Python | setup.py | HendrikVE/my_pi_drei | 7e0392dced6e54791690929d968195282796cbd8 | [
"MIT"
] | null | null | null | setup.py | HendrikVE/my_pi_drei | 7e0392dced6e54791690929d968195282796cbd8 | [
"MIT"
] | 1 | 2018-02-03T23:14:38.000Z | 2018-02-03T23:17:06.000Z | setup.py | HendrikVE/my_pi_drei | 7e0392dced6e54791690929d968195282796cbd8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
* Copyright (C) 2017 Hendrik van Essen
*
* This file is subject to the terms and conditions of the MIT License
* See the file LICENSE in the top level directory for more details.
"""
"""setup script"""
"""
BASIC SYSTEM PRIVATE COMPUTER
sudo apt-get install python... | 25.370861 | 120 | 0.655703 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
* Copyright (C) 2017 Hendrik van Essen
*
* This file is subject to the terms and conditions of the MIT License
* See the file LICENSE in the top level directory for more details.
"""
"""setup script"""
"""
BASIC SYSTEM PRIVATE COMPUTER
sudo apt-get install python... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d2786ce486ba4e4c5fe70310ec678555c0662715 | 6,728 | py | Python | movie_genre_predictor.py | iamritviksharma/movie-genre-predictor | 42d86e199d4ddf90f91412f71cc033f7ae34b58d | [
"MIT"
] | null | null | null | movie_genre_predictor.py | iamritviksharma/movie-genre-predictor | 42d86e199d4ddf90f91412f71cc033f7ae34b58d | [
"MIT"
] | null | null | null | movie_genre_predictor.py | iamritviksharma/movie-genre-predictor | 42d86e199d4ddf90f91412f71cc033f7ae34b58d | [
"MIT"
] | null | null | null | import sys
import json
import argparse
import pandas as pd
# creates a genre predictor/classifier which does multi-class (many genres) and multi-label (each movie may have more than one genre) classification
# the output of the program is the json version of this class
# create an argument parser to input the title... | 44.853333 | 153 | 0.68475 | import re
import sys
import nltk
import json
import argparse
import pandas as pd
from nltk.corpus import stopwords
from sklearn.metrics import f1_score
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing im... | 0 | 0 | 0 | 4,461 | 0 | 0 | 0 | 147 | 243 |
298b8b6fda9878e37273622e4601e97c86891d46 | 2,882 | py | Python | src/statistics.py | GuanLab/timesias | 899d1a42c8df98f6540bcfaa1782751ee7cc6536 | [
"MIT"
] | 2 | 2021-10-21T17:28:37.000Z | 2022-03-16T00:49:05.000Z | src/statistics.py | GuanLab/timesias | 899d1a42c8df98f6540bcfaa1782751ee7cc6536 | [
"MIT"
] | null | null | null | src/statistics.py | GuanLab/timesias | 899d1a42c8df98f6540bcfaa1782751ee7cc6536 | [
"MIT"
] | null | null | null | from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import precision_recall_curve, roc_curve, auc
def pearsonr_cor(pred, label):
""" Return Pearson's correlation between prediction and label
"""
cor, _ = pearsonr(pred, label)
return cor
def spearmanr_cor(pred, label):
""" Return Spearm... | 26.685185 | 79 | 0.622137 | from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import precision_recall_curve, roc_curve, auc
import pandas as pd
import numpy as np
def pearsonr_cor(pred, label):
""" Return Pearson's correlation between prediction and label
"""
cor, _ = pearsonr(pred, label)
return cor
def spearmanr_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 44 |
6a3d5fc6930e4fdb3839937e31771fbced25f62e | 1,332 | py | Python | doc/scripts/show-versions.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | 2 | 2020-09-14T06:48:39.000Z | 2020-10-12T14:21:01.000Z | doc/scripts/show-versions.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | 1 | 2019-04-11T10:23:42.000Z | 2019-04-11T10:23:42.000Z | doc/scripts/show-versions.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | 2 | 2019-03-25T02:54:20.000Z | 2019-03-27T04:06:21.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2018, Intel Corporation
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Show installed versions of doc building tools
import os.path
import sys
import pkg_resources
import subprocess
# Check all requirements listed in requirements.txt and print out version installed (if any)
pri... | 30.272727 | 114 | 0.641141 | #!/usr/bin/env python3
#
# Copyright (c) 2018, Intel Corporation
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Show installed versions of doc building tools
import os.path
import sys
import pkg_resources
import subprocess
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\03... | 0 | 0 | 0 | 210 | 0 | 0 | 0 | 0 | 23 |
727d4f7e3389f93c70f3b869e04c44bc3d533cc9 | 1,780 | py | Python | CalibTracker/SiStripESProducers/test/python/checkphase2cabling_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | CalibTracker/SiStripESProducers/test/python/checkphase2cabling_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | CalibTracker/SiStripESProducers/test/python/checkphase2cabling_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("Demo")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger = cms.Service("MessageLogger",
debugModules = cms.untracked.vstring("*"),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('DEBUG')
),
... | 35.6 | 97 | 0.730899 | import FWCore.ParameterSet.Config as cms
process = cms.Process("Demo")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger = cms.Service("MessageLogger",
debugModules = cms.untracked.vstring("*"),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('DEBUG')
),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3235bef2b64c4ed44383d234156a2f4855b1ef64 | 158 | py | Python | python/errors_and_exceptions/incorrect_regex.py | avenet/hackerrank | e522030a023af4ff50d5fc64bd3eba30144e006c | [
"MIT"
] | null | null | null | python/errors_and_exceptions/incorrect_regex.py | avenet/hackerrank | e522030a023af4ff50d5fc64bd3eba30144e006c | [
"MIT"
] | null | null | null | python/errors_and_exceptions/incorrect_regex.py | avenet/hackerrank | e522030a023af4ff50d5fc64bd3eba30144e006c | [
"MIT"
] | null | null | null | import re
cases = int(input())
for case in range(cases):
try:
re.compile(input())
print(True)
except re.error:
print(False)
| 14.363636 | 27 | 0.563291 | import re
cases = int(input())
for case in range(cases):
try:
re.compile(input())
print(True)
except re.error:
print(False)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c79163248b243078743b5d3dfe3980d7050c117 | 9,687 | py | Python | qm-theory-benchmark/data/torsiondrives_benchmark.py | MobleyLab/qm-theory-benchmark | e7f0a002ecf7ec8ded2c34b1b65b96467884df61 | [
"MIT"
] | null | null | null | qm-theory-benchmark/data/torsiondrives_benchmark.py | MobleyLab/qm-theory-benchmark | e7f0a002ecf7ec8ded2c34b1b65b96467884df61 | [
"MIT"
] | null | null | null | qm-theory-benchmark/data/torsiondrives_benchmark.py | MobleyLab/qm-theory-benchmark | e7f0a002ecf7ec8ded2c34b1b65b96467884df61 | [
"MIT"
] | null | null | null | import copy
from collections import defaultdict
import numpy as np
from simtk import unit
PARTICLE = unit.mole.create_unit(
6.02214076e23 ** -1,
"particle",
"particle",
)
HARTREE_PER_PARTICLE = unit.hartree / PARTICLE
HARTREE_TO_KCALMOL = HARTREE_PER_PARTICLE.conversion_factor_to(
unit.kilocalorie_per_... | 30.948882 | 83 | 0.533395 | import copy
import io
from collections import defaultdict
import click
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import rcParams
from matplotlib.backends.backend_pdf import PdfPages
from openff.toolkit.topology import Molecule
from PIL import Image
fro... | 0 | 7,549 | 0 | 0 | 0 | 0 | 0 | 80 | 266 |
b993def195f9c4c9aae8101628c90d98f3c754f7 | 1,045 | py | Python | Chapter10/linkedList.py | hexinatgithub/CLRS | c765db7806b566be18ae1c8f6777ebb61a25dfe0 | [
"MIT"
] | 1 | 2016-10-27T15:02:16.000Z | 2016-10-27T15:02:16.000Z | Chapter10/linkedList.py | hexinatgithub/CLRS | c765db7806b566be18ae1c8f6777ebb61a25dfe0 | [
"MIT"
] | null | null | null | Chapter10/linkedList.py | hexinatgithub/CLRS | c765db7806b566be18ae1c8f6777ebb61a25dfe0 | [
"MIT"
] | null | null | null |
# l = linkedList()
# x1 = elements(key=5)
# x2 = elements(key=6)
# x3 = elements(key=7)
# x4 = elements(key=8)
# x5 = elements(key=9)
# l.list_insert(x1)
# l.list_insert(x2)
# l.list_insert(x3)
# l.list_insert(x4)
# l.list_insert(x5)
# s1 = l.list_search(k=7)
# print s1.key
# l.list_delete(s1)
# s1 = l.list_search(k... | 18.333333 | 37 | 0.645933 | class elements(object):
"""docstring for elements"""
def __init__(self, key):
super(elements, self).__init__()
self.pre = None
self.key = key
self.next = None
class linkedList(object):
"""docstring for linkedList"""
def __init__(self):
super(linkedList, self).__init__()
self.nil = elements(None)
sel... | 0 | 0 | 0 | 657 | 0 | 0 | 0 | 0 | 45 |
b9adfc1e47c2ec6be5bf71142ad5ed0f499e3d15 | 2,393 | py | Python | adb.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | 1 | 2021-12-10T18:31:41.000Z | 2021-12-10T18:31:41.000Z | adb.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | null | null | null | adb.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | null | null | null | import sys
import build
import os
from pathlib import Path
args = get_args(sys.argv)
if args.listadversaries == True:
adversary_list = os.listdir(os.path.join(Path(__file__).parent, "adversary"))
for item in adversary_list:
if os.path.isdir(os.path.join(Path(__file__).parent, "adversary", item)) and ... | 45.150943 | 169 | 0.65608 | from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
import sys
import build
import os
from pathlib import Path
def get_args(arg_list):
del arg_list[0]
try:
parser = ArgumentParser(description='program description', formatter_class=RawDescriptionHelpFormatter, prog='prog... | 0 | 0 | 0 | 0 | 0 | 1,488 | 0 | 41 | 67 |
a47b724cd00ade7c197c4e23a8991904ad20cd95 | 2,107 | py | Python | model/virus_file.py | FellowHashbrown/virus.sh | 757e50fa402f63ab7161518dcec7e1441aa880dd | [
"MIT"
] | null | null | null | model/virus_file.py | FellowHashbrown/virus.sh | 757e50fa402f63ab7161518dcec7e1441aa880dd | [
"MIT"
] | null | null | null | model/virus_file.py | FellowHashbrown/virus.sh | 757e50fa402f63ab7161518dcec7e1441aa880dd | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 35.711864 | 100 | 0.601804 | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from model import Directory
from model import NormalFile
class VirusFile(NormalFile):
"""The VirusFile class is the structure that acts as a Virus File on the
filesystem that still has lines of data but also deletes files that are
not other virus fil... | 0 | 726 | 0 | 1,244 | 0 | 0 | 0 | 13 | 72 |
934b67d4290ba042674635e6d16d5a9349437d7f | 462 | py | Python | plot/plot.py | RuoAndo/Usenix_LISA19 | 966ee9593cf924ef8a8ace45cdb826b74b3b9001 | [
"MIT"
] | null | null | null | plot/plot.py | RuoAndo/Usenix_LISA19 | 966ee9593cf924ef8a8ace45cdb826b74b3b9001 | [
"MIT"
] | null | null | null | plot/plot.py | RuoAndo/Usenix_LISA19 | 966ee9593cf924ef8a8ace45cdb826b74b3b9001 | [
"MIT"
] | null | null | null | #coding:utf-8
# K-means
import numpy as np
import sys
import matplotlib.pyplot as plt
argvs = sys.argv
if __name__ == "__main__":
data = np.genfromtxt(argvs[1], delimiter=",")
print(data)
#plt.subplot(2, 1, 1)
plt.plot(data[:,3])
data2 = np.genfromtxt(argvs[2], delimiter=",")
print(data2)
... | 16.5 | 50 | 0.588745 | #coding:utf-8
# K-means
import numpy as np
import sys
import matplotlib.pyplot as plt
argvs = sys.argv
if __name__ == "__main__":
data = np.genfromtxt(argvs[1], delimiter=",")
print(data)
#plt.subplot(2, 1, 1)
plt.plot(data[:,3])
data2 = np.genfromtxt(argvs[2], delimiter=",")
print(data2)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
26c113ab0aa0a4e40565dd5f43597c497b985366 | 8,240 | py | Python | model.py | 594422814/ContrastCorr | 9b117944275933132fad6921bbabb3afddca60bd | [
"MIT"
] | 34 | 2020-12-09T08:04:41.000Z | 2021-09-07T14:15:27.000Z | model.py | 594422814/ContrastCorr | 9b117944275933132fad6921bbabb3afddca60bd | [
"MIT"
] | null | null | null | model.py | 594422814/ContrastCorr | 9b117944275933132fad6921bbabb3afddca60bd | [
"MIT"
] | 9 | 2020-12-11T07:14:38.000Z | 2022-03-18T02:23:26.000Z | import torch
import torch.nn as nn
def transform(aff, frame1):
"""
Given aff, copy from frame1 to construct frame2.
INPUTS:
- aff: (h*w)*(h*w) affinity matrix
- frame1: n*c*h*w feature map
"""
b,c,h,w = frame1.size()
frame1 = frame1.view(b,c,-1)
frame2 = torch.bmm(frame1, aff)
return frame2.view(b,c,h,w)
... | 33.632653 | 152 | 0.701214 | import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
from libs.net_utils import NLM, NLM_dot, NLM_woSoft, NLM_NC_woSoft, Batch_Contrastive
from torchvision.models import resnet18
from libs.autoencoder import encoder3, decoder3, encoder_res18, encoder_res50
from libs.utils import *
import pdb... | 0 | 0 | 0 | 5,679 | 0 | 395 | 0 | 130 | 225 |
ce92d65b19e53232170e22e1a49d257ea38bcdce | 1,108 | py | Python | day11/test_day11.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | day11/test_day11.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | day11/test_day11.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | import day11 as day
INPUTFOLDER = day.get_path()
| 25.181818 | 64 | 0.694043 | import day11 as day
from helper import loadingUtils
INPUTFOLDER = day.get_path()
def test_part_1():
result = day.run_part_1(INPUTFOLDER+"/test1")
assert result == 37
def test_part_1_real():
result = day.run_part_1(INPUTFOLDER+"/input1")
assert result == 2178
def test_view_2():
seatmap = loadin... | 0 | 0 | 0 | 0 | 0 | 860 | 0 | 10 | 183 |
4881bacc93ebf7813cff88692566192aa95fce8e | 815 | py | Python | tests/test_overdoses.py | aculpcano/md-accidental-overdoses | 9a558fee8b2f80ea81824d09078b886dc6f0ccd0 | [
"MIT"
] | null | null | null | tests/test_overdoses.py | aculpcano/md-accidental-overdoses | 9a558fee8b2f80ea81824d09078b886dc6f0ccd0 | [
"MIT"
] | null | null | null | tests/test_overdoses.py | aculpcano/md-accidental-overdoses | 9a558fee8b2f80ea81824d09078b886dc6f0ccd0 | [
"MIT"
] | null | null | null | from unittest import main
if __name__ == '__main__':
main()
| 29.107143 | 78 | 0.72638 | from unittest import TestCase, main
import overdoses
import pandas as pd
from pandas.util.testing import assert_series_equal
class OverdosesTestCase(TestCase):
@staticmethod
def test_get_database_data():
actual_result = overdoses.OverdoseDatabase().query(2013, 'Alcohol')
actual_result = pd.D... | 0 | 358 | 0 | 266 | 0 | 0 | 0 | 33 | 91 |
92f20fb56f93431fc20b90d0fba5ee34fd9c98cf | 5,590 | py | Python | Chapter 5/B05034_ch5_SRC_V2/src_ch5_python2/wargame/test/test_wargame.py | kunal2494/Learning-Python-Application-Development | 241bec5d5340e95cd68aef813c9ce8b0fca98986 | [
"MIT"
] | 64 | 2016-12-15T20:38:45.000Z | 2022-03-31T06:38:39.000Z | Chapter 5/B05034_ch5_SRC_V2/src_ch5_python2/wargame/test/test_wargame.py | kunal2494/Learning-Python-Application-Development | 241bec5d5340e95cd68aef813c9ce8b0fca98986 | [
"MIT"
] | null | null | null | Chapter 5/B05034_ch5_SRC_V2/src_ch5_python2/wargame/test/test_wargame.py | kunal2494/Learning-Python-Application-Development | 241bec5d5340e95cd68aef813c9ce8b0fca98986 | [
"MIT"
] | 48 | 2016-09-14T20:01:31.000Z | 2021-11-25T09:03:37.000Z | """wargame.test.test_wargame
This module contains unit tests for various modules in wargame package.
This module is compatible with Python 2.7.9. It contains
supporting code for the book, Learning Python Application Development,
Packt Publishing.
:copyright: 2016, Ninad Sathaye
:license: The MIT License (MIT) . See... | 36.064516 | 80 | 0.635242 | """wargame.test.test_wargame
This module contains unit tests for various modules in wargame package.
This module is compatible with Python 2.7.9. It contains
supporting code for the book, Learning Python Application Development,
Packt Publishing.
:copyright: 2016, Ninad Sathaye
:license: The MIT License (MIT) . See... | 0 | 0 | 0 | 4,498 | 0 | 0 | 0 | 72 | 178 |
588814726948fc619cc4f732d850d8dc0738281f | 7,335 | py | Python | scripts/replicate_analysis.py | ThibaultLatrille/MutationSelectionDrift | 7b9e4fe5b181413823ddba9b637af553f977836c | [
"Unlicense",
"MIT"
] | 1 | 2022-01-20T14:54:20.000Z | 2022-01-20T14:54:20.000Z | scripts/replicate_analysis.py | ThibaultLatrille/MutationSelectionDrift | 7b9e4fe5b181413823ddba9b637af553f977836c | [
"Unlicense",
"MIT"
] | null | null | null | scripts/replicate_analysis.py | ThibaultLatrille/MutationSelectionDrift | 7b9e4fe5b181413823ddba9b637af553f977836c | [
"Unlicense",
"MIT"
] | null | null | null | import os
from glob import glob
from ete3 import Tree
os.chdir("../DataEmpirical")
exp_dirs = sorted(
set(["_".join(i.split("_")[:-1]) for i in os.listdir("Experiments") if ("Replicates" in i) and ("Isopods" in i)]))
os.makedirs("Analysis/DataFrame", exist_ok=True)
file_format = "pdf"
dataset = pd.read_csv("I... | 53.152174 | 120 | 0.537423 | import os
from glob import glob
from ete3 import Tree
from plot_module import *
os.chdir("../DataEmpirical")
exp_dirs = sorted(
set(["_".join(i.split("_")[:-1]) for i in os.listdir("Experiments") if ("Replicates" in i) and ("Isopods" in i)]))
os.makedirs("Analysis/DataFrame", exist_ok=True)
file_format = "pdf"
... | 0 | 0 | 0 | 0 | 0 | 203 | 0 | 4 | 68 |
b4f3eb60e431c7491803dd069e84e30527feb685 | 59,350 | py | Python | tests/test_DeriveAlive.py | cs207-group19/Automatic-Differentiation | e01add64b3c310f64ae1902c39f41fd2695299cb | [
"MIT"
] | 9 | 2019-02-11T03:53:34.000Z | 2021-11-19T21:41:05.000Z | tests/test_DeriveAlive.py | cs207-group19/cs207-FinalProject | e01add64b3c310f64ae1902c39f41fd2695299cb | [
"MIT"
] | null | null | null | tests/test_DeriveAlive.py | cs207-group19/cs207-FinalProject | e01add64b3c310f64ae1902c39f41fd2695299cb | [
"MIT"
] | 3 | 2019-11-19T01:20:27.000Z | 2020-11-04T19:05:15.000Z | # Test suite for DeriveAlive module
# These lines should be included for Travis/Coverall
import sys
sys.path.append('../')
def test_DeriveAlive_Var():
'''Test constructor of Var class to ensure proper variable initializations.'''
# Run tests within test_DeriveAliveVar
test_scalar_without_bracket()
test_scalar_wi... | 32.150596 | 103 | 0.497473 | # Test suite for DeriveAlive module
# These lines should be included for Travis/Coverall
import sys
sys.path.append('../')
import DeriveAlive.DeriveAlive as da
import numpy as np
import math
def test_DeriveAlive_Var():
'''Test constructor of Var class to ensure proper variable initializations.'''
def test_scalar_... | 0 | 0 | 0 | 0 | 0 | 53,542 | 0 | 2 | 2,746 |
953608a1cbe781703af9335942853c23d2d669b3 | 1,498 | py | Python | ngsTools/io/__init__.py | Vassyli/ngstools | ced1ca7ca6e5137f7dde35c68c06a4b245b5fd00 | [
"MIT"
] | null | null | null | ngsTools/io/__init__.py | Vassyli/ngstools | ced1ca7ca6e5137f7dde35c68c06a4b245b5fd00 | [
"MIT"
] | null | null | null | ngsTools/io/__init__.py | Vassyli/ngstools | ced1ca7ca6e5137f7dde35c68c06a4b245b5fd00 | [
"MIT"
] | null | null | null | """Subpackage for handling import and export of sequencing data.
"""
import os
from .GenomFeatureReader import GenomFeatureReader
from .GenomReader import GenomReader
from .SamReader import SamReader
_extension_to_reader = {
"sam": SamReader.open,
"fasta": GenomReader.open,
"fa": GenomReader.open,
"... | 28.264151 | 95 | 0.692924 | """Subpackage for handling import and export of sequencing data.
"""
import os
from .GenomFeatureReader import GenomFeatureReader
from .GenomReader import GenomReader
from .SamReader import SamReader, SamAlignedRead
from .BaseAlignedRead import BaseAlignedRead
from .BedtoolsIntersectionReader import BedtoolsIntersec... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 110 | 44 |
52ab3370f8083da5020f4f251fd3c07d6f530208 | 3,730 | py | Python | QNEM/history.py | SimBussy/C-mix | 1976edbb367bb27e7bb415384e8219b4ba99de61 | [
"MIT"
] | 5 | 2018-06-05T07:30:11.000Z | 2020-11-24T17:41:37.000Z | QNEM/history.py | SimBussy/C-mix | 1976edbb367bb27e7bb415384e8219b4ba99de61 | [
"MIT"
] | null | null | null | QNEM/history.py | SimBussy/C-mix | 1976edbb367bb27e7bb415384e8219b4ba99de61 | [
"MIT"
] | 2 | 2019-06-06T10:34:58.000Z | 2021-10-06T19:57:46.000Z | # -*- coding: utf-8 -*-
# Author: Simon Bussy <simon.bussy@gmail.com>
| 30.325203 | 78 | 0.594906 | # -*- coding: utf-8 -*-
# Author: Simon Bussy <simon.bussy@gmail.com>
import numpy as np
from collections import defaultdict
def n_iter_func(n_iter=0, **kwargs):
return n_iter
def obj_func(obj=0, **kwargs):
return obj
def rel_obj_func(rel_obj=0, **kwargs):
return rel_obj
def spars_func(coeffs=None,... | 0 | 0 | 0 | 3,286 | 0 | 198 | 0 | 11 | 160 |
d69c538bee0142571d4579867231e6564e75be66 | 6,742 | py | Python | sampleapp/services.py | wardal/QuickBooksOAuth2CelerySampleApp | 9f6b4654e3996e0b75fcc95d10df112f51926165 | [
"Apache-2.0"
] | 1 | 2020-07-10T15:02:27.000Z | 2020-07-10T15:02:27.000Z | sampleapp/services.py | wardal/QuickBooksOAuth2CelerySampleApp | 9f6b4654e3996e0b75fcc95d10df112f51926165 | [
"Apache-2.0"
] | null | null | null | sampleapp/services.py | wardal/QuickBooksOAuth2CelerySampleApp | 9f6b4654e3996e0b75fcc95d10df112f51926165 | [
"Apache-2.0"
] | 1 | 2018-08-26T20:50:25.000Z | 2018-08-26T20:50:25.000Z |
# token can either be an accessToken or a refreshToken
# The validation steps can be found at ours docs at developer.intuit.com
# for decoding ID Token
# Returns a securely generated random string. Source from the django.utils.crypto module.
# Create a random secret key. Source from the django.utils.cr... | 37.043956 | 113 | 0.713438 | import requests
import base64
import json
import random
from jose import jwk
from datetime import datetime
from django.conf import settings
from sampleapp.models import Bearer, QuickBooksDiscoveryDocument
def get_discovery_document():
r = requests.get(settings.DISCOVERY_DOCUMENT)
if r.status_code >= 400:
... | 0 | 0 | 0 | 0 | 0 | 5,930 | 0 | 29 | 450 |