hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9bbdbda9b81987418bcce3b99adb7801410b9388 | 1,658 | py | Python | figures/apps.py | groovetch/edx-figures | a69fc1195c05176ac7dae90b337dd77f4bd9679f | [
"MIT"
] | 43 | 2018-05-29T20:01:25.000Z | 2021-12-02T09:43:17.000Z | figures/apps.py | groovetch/edx-figures | a69fc1195c05176ac7dae90b337dd77f4bd9679f | [
"MIT"
] | 330 | 2018-05-30T17:06:15.000Z | 2022-03-16T15:52:22.000Z | figures/apps.py | groovetch/edx-figures | a69fc1195c05176ac7dae90b337dd77f4bd9679f | [
"MIT"
] | 40 | 2018-10-06T00:15:58.000Z | 2022-02-14T12:44:45.000Z | """
Provides application configuration for Figures.
As well as default values for running Figures along with functions to
add entries to the Django conf settings needed to run Figures.
"""
from __future__ import absolute_import
from django.apps import AppConfig
try:
from openedx.core.djangoapps.plugins.constants... | 27.180328 | 86 | 0.603739 |
6cab2a5a61defa5bb28e5154ee2ae0775e64f803 | 1,386 | py | Python | backbone/utils/tokenize.py | wutong8023/PLM4CL | 4e9e98be425150ad75468b26feb8fb7f5e93c34b | [
"MIT"
] | 1 | 2021-06-30T04:27:57.000Z | 2021-06-30T04:27:57.000Z | backbone/utils/tokenize.py | wutong8023/PLM4CL | 4e9e98be425150ad75468b26feb8fb7f5e93c34b | [
"MIT"
] | null | null | null | backbone/utils/tokenize.py | wutong8023/PLM4CL | 4e9e98be425150ad75468b26feb8fb7f5e93c34b | [
"MIT"
] | null | null | null | """
Author: Tong
Time: 09-03-2020
"""
import torch
from transformers import BertModel, BertTokenizer
from backbone import import_from
from backbone import supported_ptm
class CustomizedTokenizer:
def __init__(self, max_len=36, ptm="bert", special_token=()):
self.ptm = ptm.lower()
assert self.pt... | 34.65 | 107 | 0.569264 |
8619fa02f844007d102a0a9f78363d783853fee1 | 3,798 | py | Python | distance/asyncmongo.py | shannon-jia/distance | dc9a2c0736b8e8578ba1a1ac87c8650ba95e1d90 | [
"MIT"
] | null | null | null | distance/asyncmongo.py | shannon-jia/distance | dc9a2c0736b8e8578ba1a1ac87c8650ba95e1d90 | [
"MIT"
] | null | null | null | distance/asyncmongo.py | shannon-jia/distance | dc9a2c0736b8e8578ba1a1ac87c8650ba95e1d90 | [
"MIT"
] | null | null | null | import asyncio
from motor import motor_asyncio
from pymongo.errors import AutoReconnect, ConnectionFailure
import logging
from urllib.parse import urlparse
# import pprint
log = logging.getLogger(__name__)
class AsyncMongo():
DEFAULT_PORT = 27017
def __init__(self, uri=None, loop=None, collection='links'):
... | 29.44186 | 68 | 0.577146 |
b33d19c797a6c6eb489276f40c6ce4a7a03a0e51 | 477 | py | Python | pfxbrick/scripts/pfxdump.py | fx-bricks/pfx-brick-py | dacd3c04fcbbecef7a6a5d9603ed8cf9a2eb3469 | [
"MIT"
] | 11 | 2018-04-26T22:53:44.000Z | 2022-02-14T13:44:27.000Z | pfxbrick/scripts/pfxdump.py | fx-bricks/pfx-brick-py | dacd3c04fcbbecef7a6a5d9603ed8cf9a2eb3469 | [
"MIT"
] | 3 | 2021-01-14T18:48:48.000Z | 2022-02-16T04:06:06.000Z | pfxbrick/scripts/pfxdump.py | fx-bricks/pfx-brick-py | dacd3c04fcbbecef7a6a5d9603ed8cf9a2eb3469 | [
"MIT"
] | 2 | 2018-05-20T11:30:53.000Z | 2022-02-15T06:42:37.000Z | #! /usr/bin/env python3
from sys import argv
from pfxbrick import *
if __name__ == "__main__":
if len(argv) < 2:
print("Usage: pfxdump address bytes")
print(
" where address is the flash start address and bytes is number of bytes to dump"
)
exit()
b = PFxBrick()
... | 21.681818 | 93 | 0.557652 |
bc7e728f5dc37589b2e9da778da24228636e7fbb | 3,073 | py | Python | test/http/case.py | tkomatsu/webserv | 9c54145ddc95eabfff6744c7c77176a4a63370ae | [
"MIT"
] | null | null | null | test/http/case.py | tkomatsu/webserv | 9c54145ddc95eabfff6744c7c77176a4a63370ae | [
"MIT"
] | 51 | 2021-08-05T11:47:52.000Z | 2021-09-29T04:04:42.000Z | test/http/case.py | tkomatsu/webserv | 9c54145ddc95eabfff6744c7c77176a4a63370ae | [
"MIT"
] | 1 | 2021-09-21T14:28:32.000Z | 2021-09-21T14:28:32.000Z | #!/usr/bin/env python3
# coding: UTF-8
import requests
import subprocess
import time
import run
import re
index = 0
class Color:
BLACK = '\033[30m'
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
PURPLE = '\033[35m'
CYAN = '\033[36m'... | 30.73 | 159 | 0.636837 |
67e5b2e175507543c249a4effe9b93988cd7e794 | 1,349 | py | Python | statement_parser/expenses/legal.py | jamiehannaford/statement-parser | 93925b5903a4570f66f3e7b7d5d839412bde1da0 | [
"MIT"
] | 5 | 2021-09-01T03:27:02.000Z | 2022-03-31T16:31:23.000Z | statement_parser/expenses/legal.py | jamiehannaford/statement-parser | 93925b5903a4570f66f3e7b7d5d839412bde1da0 | [
"MIT"
] | null | null | null | statement_parser/expenses/legal.py | jamiehannaford/statement-parser | 93925b5903a4570f66f3e7b7d5d839412bde1da0 | [
"MIT"
] | null | null | null | from statement_parser.expenses.expense import Expense
from statement_parser.expense_group import ExpenseGroup
from statement_parser.expenses.constants import NAME_LEGAL
from xbrl.instance import NumericFact
TAGS_LEGAL = [
"GainLossRelatedToLitigationSettlement".lower(),
"LossContingencyLossInPeriod".lower(),
... | 35.5 | 90 | 0.717569 |
c21aa3df8e3e8af1ffaf783f3cb514e8dafea96b | 9,702 | py | Python | orchid_DiseasePredict/datasets/Attention_in_several_test/LSTM32_LSTM32_LSTM32_LSTM32_A_LSTM64_LSTM64_LSTM64.py | chengzee/disease_predict | d7a3c57b710ab2e93d56c8d73aeaa21120d3e98c | [
"MIT"
] | null | null | null | orchid_DiseasePredict/datasets/Attention_in_several_test/LSTM32_LSTM32_LSTM32_LSTM32_A_LSTM64_LSTM64_LSTM64.py | chengzee/disease_predict | d7a3c57b710ab2e93d56c8d73aeaa21120d3e98c | [
"MIT"
] | null | null | null | orchid_DiseasePredict/datasets/Attention_in_several_test/LSTM32_LSTM32_LSTM32_LSTM32_A_LSTM64_LSTM64_LSTM64.py | chengzee/disease_predict | d7a3c57b710ab2e93d56c8d73aeaa21120d3e98c | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import csv
from keras.layers import Dense, Lambda, dot, Activation, concatenate
from keras.layers import Layer
import keras.backend as K
# Parameters
# -------------------------------------------------------------------------------------------------------------------
bed = [631, ... | 45.981043 | 283 | 0.56813 |
97c5a261f85cac24dc347ea904bc76536a8b807c | 129 | py | Python | irekua_rest_api/serializers/users/__init__.py | IslasGECI/irekua-rest-api | 35cf5153ed7f54d12ebad2ac07d472585f04e3e7 | [
"BSD-4-Clause"
] | null | null | null | irekua_rest_api/serializers/users/__init__.py | IslasGECI/irekua-rest-api | 35cf5153ed7f54d12ebad2ac07d472585f04e3e7 | [
"BSD-4-Clause"
] | 11 | 2020-03-28T18:51:50.000Z | 2022-01-13T01:47:40.000Z | irekua_rest_api/serializers/users/__init__.py | IslasGECI/irekua-rest-api | 35cf5153ed7f54d12ebad2ac07d472585f04e3e7 | [
"BSD-4-Clause"
] | 1 | 2021-05-06T19:38:14.000Z | 2021-05-06T19:38:14.000Z | from . import institutions
from . import roles
from . import users
__all__ = [
'institutions',
'roles',
'users',
]
| 11.727273 | 26 | 0.627907 |
f34a9d4be7ecadc3a01f8a91f41b6ddcadd6e69e | 9,999 | py | Python | venv/Lib/site-packages/pip/_internal/operations/freeze.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 38,667 | 2015-01-01T00:15:34.000Z | 2022-03-31T22:57:03.000Z | venv/Lib/site-packages/pip/_internal/operations/freeze.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 1,192 | 2015-01-03T07:59:34.000Z | 2022-03-31T13:22:26.000Z | venv/Lib/site-packages/pip/_internal/operations/freeze.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 11,269 | 2015-01-01T08:41:17.000Z | 2022-03-31T16:12:52.000Z | import collections
import logging
import os
from typing import (
Container,
Dict,
Iterable,
Iterator,
List,
Optional,
Set,
Tuple,
Union,
)
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.pkg_resources import Distribution, Requirement, RequirementParseError... | 37.732075 | 86 | 0.532053 |
61a70ed2641ed0cca6dbd51c5fcf9667d90d9e0b | 429 | py | Python | src/templates/base.py | vmesel/jsv | 373f6635061fabe636a87227a71b758e135ce2b6 | [
"MIT"
] | 9 | 2020-08-19T14:08:58.000Z | 2022-02-14T05:48:04.000Z | src/templates/base.py | vmesel/jsv | 373f6635061fabe636a87227a71b758e135ce2b6 | [
"MIT"
] | 11 | 2020-08-20T14:46:43.000Z | 2020-09-07T20:43:39.000Z | src/templates/base.py | vmesel/jsv | 373f6635061fabe636a87227a71b758e135ce2b6 | [
"MIT"
] | 1 | 2020-08-26T21:57:51.000Z | 2020-08-26T21:57:51.000Z | dataset_metadata = {
{% for key, property in properties %}
"{{ key }}": {{ property|getDefault|stringify|safe|replace("null", "None") }},{% if property|getDescription %} # {{ property|getDescription }}{% endif %}
{% for example in property.examples %}
{% if not loop.first or property.default %}
# [exa... | 39 | 158 | 0.606061 |
5e81e5c89f3467f06c1f52783f6be5f175e28145 | 1,656 | py | Python | sample/update_channel.py | tora01/SkillLab | 61ebfaf45c503b9e6f4a3d05a7edd4de2fcad93e | [
"CC0-1.0"
] | 2 | 2020-09-09T02:40:23.000Z | 2021-09-12T18:08:15.000Z | sample/update_channel.py | tora01/SkillLab | 61ebfaf45c503b9e6f4a3d05a7edd4de2fcad93e | [
"CC0-1.0"
] | 1 | 2021-09-14T09:36:38.000Z | 2021-09-14T09:36:38.000Z | sample/update_channel.py | tora01/SkillLab | 61ebfaf45c503b9e6f4a3d05a7edd4de2fcad93e | [
"CC0-1.0"
] | 19 | 2021-09-07T06:11:29.000Z | 2021-09-07T07:45:08.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import requests
api_key = ''
channle_id = '1499081'
data_file = "./data/cpu_temp.dat"
_ts_base_url = "https://api.thingspeak.com"
ts_update_url = _ts_base_url + "/update"
# GET https://api.thingspeak.com/update?api_key=MSUJ80Z21B6XIS7G&field1=0
# HT... | 22.08 | 74 | 0.673913 |
0527516423e3578a88b2f2141980e6684211a408 | 1,235 | py | Python | main.py | mboyr4z/Yolov5_Detect_Toolkit | 569d7663616c67f31cdf11b2ba4257f0a1566415 | [
"MIT"
] | 8 | 2021-07-18T11:55:39.000Z | 2022-03-25T19:17:30.000Z | main.py | mboyr4z/Yolov5_Detect_Toolkit | 569d7663616c67f31cdf11b2ba4257f0a1566415 | [
"MIT"
] | null | null | null | main.py | mboyr4z/Yolov5_Detect_Toolkit | 569d7663616c67f31cdf11b2ba4257f0a1566415 | [
"MIT"
] | null | null | null | #python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source data/images/
# if __name__ == "__main__":
# os.chdir("Yolov5_Detect_Toolkit/yolov5-master")
# os.system('cmd /c "python detect.py --weights ../last.pt --img 640 --conf 0.25 --source ../val"')
import os
from PyQt5 import QtWidgets
from degis... | 36.323529 | 103 | 0.756275 |
fb919028bdb07eadcfed4582db6ee7f7d0d310ff | 435 | py | Python | preprocessing/__init__.py | jarednielsen/speech2phone | 4214446f16c7cba573d500d5e88a9b89640f725e | [
"MIT"
] | 1 | 2021-01-19T13:43:27.000Z | 2021-01-19T13:43:27.000Z | preprocessing/__init__.py | jarednielsen/speech2phone | 4214446f16c7cba573d500d5e88a9b89640f725e | [
"MIT"
] | null | null | null | preprocessing/__init__.py | jarednielsen/speech2phone | 4214446f16c7cba573d500d5e88a9b89640f725e | [
"MIT"
] | null | null | null | """Everything imported here will be available under `speech2phone.preprocessing`. So even though the function
`test_preprocess` is in the filesystem as `speech2phone/preprocessing/preprocessing.py -> test_preprocess`, it is
available in Python as `speech2phone.preprocessing.test_preprocess`.
Jared Nielsen. 2019-02-05.... | 43.5 | 113 | 0.786207 |
52e907191d5a563b948c97062e88adbd595e8d9e | 12,231 | py | Python | sdk/python/pulumi_kubernetes/core/v1/PersistentVolume.py | csssuf/pulumi-kubernetes | 8d007166d0e8968fcabaeecd0cee13f9c08d97f1 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/core/v1/PersistentVolume.py | csssuf/pulumi-kubernetes | 8d007166d0e8968fcabaeecd0cee13f9c08d97f1 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/core/v1/PersistentVolume.py | csssuf/pulumi-kubernetes | 8d007166d0e8968fcabaeecd0cee13f9c08d97f1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outp... | 55.094595 | 335 | 0.69005 |
3dc49b0046223926dcf05baa9b6e0c46684795e4 | 10,051 | py | Python | Wrapping/Python/vtkmodules/gtk/GtkVTKRenderWindowInteractor.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 1,755 | 2015-01-03T06:55:00.000Z | 2022-03-29T05:23:26.000Z | Wrapping/Python/vtkmodules/gtk/GtkVTKRenderWindowInteractor.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 29 | 2015-04-23T20:58:30.000Z | 2022-03-02T16:16:42.000Z | Wrapping/Python/vtkmodules/gtk/GtkVTKRenderWindowInteractor.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 1,044 | 2015-01-05T22:48:27.000Z | 2022-03-31T02:38:26.000Z | """
Description:
Provides a pyGtk vtkRenderWindowInteractor widget. This embeds a
vtkRenderWindow inside a GTK widget and uses the
vtkGenericRenderWindowInteractor for the event handling. This is
based on vtkTkRenderWindow.py.
The class uses the gtkgl.GtkGLArea widget (gtkglarea). This avoids
a lot of ... | 33.392027 | 84 | 0.613471 |
d97ab9d71abc19b93fc02e9bc6fd06b9f6bb87ec | 992 | py | Python | petstagram/petstagram/common/helpers.py | batsandi/petstagram_2 | f6c2cce00862e2b6b77bfc143cc8efb55fa46735 | [
"MIT"
] | null | null | null | petstagram/petstagram/common/helpers.py | batsandi/petstagram_2 | f6c2cce00862e2b6b77bfc143cc8efb55fa46735 | [
"MIT"
] | null | null | null | petstagram/petstagram/common/helpers.py | batsandi/petstagram_2 | f6c2cce00862e2b6b77bfc143cc8efb55fa46735 | [
"MIT"
] | null | null | null | from django import forms
class BootstrapFormMixin:
fields = {}
def _init_bootstrap_form_controls(self):
for _, field in self.fields.items():
if not hasattr(field.widget, 'attrs'):
setattr(field.widget, 'attrs', {})
if 'class' not in field.widget.attrs:
... | 33.066667 | 86 | 0.580645 |
ab52b16a779e4c81c3c28aa9fdbcff697ce66b70 | 3,236 | py | Python | profiles_project/settings.py | ivancekic/profiles-rest-api | 698720bf566252b22dc56a6ea989cb47494bf8ea | [
"MIT"
] | null | null | null | profiles_project/settings.py | ivancekic/profiles-rest-api | 698720bf566252b22dc56a6ea989cb47494bf8ea | [
"MIT"
] | null | null | null | profiles_project/settings.py | ivancekic/profiles-rest-api | 698720bf566252b22dc56a6ea989cb47494bf8ea | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 25.68254 | 91 | 0.702101 |
91dd76c89c0c99b6b7b816ba3f500c033d3682e0 | 3,163 | py | Python | examples/demo-client.py | edwinfeener/monolithe | 0f024b2ec7d4c5a2229612280e5e559bf2667ba5 | [
"BSD-3-Clause"
] | 18 | 2015-06-24T18:35:20.000Z | 2022-01-19T19:04:00.000Z | examples/demo-client.py | edwinfeener/monolithe | 0f024b2ec7d4c5a2229612280e5e559bf2667ba5 | [
"BSD-3-Clause"
] | 63 | 2015-11-03T18:57:12.000Z | 2020-09-30T02:54:49.000Z | examples/demo-client.py | edwinfeener/monolithe | 0f024b2ec7d4c5a2229612280e5e559bf2667ba5 | [
"BSD-3-Clause"
] | 38 | 2015-10-23T19:04:44.000Z | 2021-06-04T08:13:33.000Z | #!/usr/bin/env python
from __future__ import print_function
import sys
import os
import importlib
# Ho, Hi There!
# I guess you are coming from my good friend, the README file
# He's a nice guy, and I'm glad you have listen to him :)
# Please go through this example, and you'll uncover a bit of
# of the awesomeness o... | 33.648936 | 127 | 0.719254 |
2742e83ad4a70fb695c99242b5af09166602e02f | 10,105 | py | Python | kubernetes/client/models/v1_topology_spread_constraint.py | carloscastrojumo/python | f461dd42d48650a4ae1b41d630875cad9fcb68ad | [
"Apache-2.0"
] | 2 | 2021-03-09T12:42:05.000Z | 2021-03-09T13:27:50.000Z | kubernetes/client/models/v1_topology_spread_constraint.py | carloscastrojumo/python | f461dd42d48650a4ae1b41d630875cad9fcb68ad | [
"Apache-2.0"
] | 7 | 2021-04-13T03:04:42.000Z | 2022-03-02T03:10:18.000Z | kubernetes/client/models/v1_topology_spread_constraint.py | carloscastrojumo/python | f461dd42d48650a4ae1b41d630875cad9fcb68ad | [
"Apache-2.0"
] | 1 | 2021-06-13T09:21:37.000Z | 2021-06-13T09:21:37.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.17
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 48.581731 | 812 | 0.672241 |
ff7bbc9fdea6b7b64e47b018b32d7c2378febda1 | 3,651 | py | Python | scripts/encode_renditions.py | cyberj0g/verification-classifier | efb19a3864e27a7f149a1c27ee8e13eaa19f96eb | [
"MIT"
] | 8 | 2019-06-06T08:16:45.000Z | 2021-06-26T11:53:48.000Z | scripts/encode_renditions.py | cyberj0g/verification-classifier | efb19a3864e27a7f149a1c27ee8e13eaa19f96eb | [
"MIT"
] | 95 | 2019-03-27T08:36:01.000Z | 2022-02-10T00:15:20.000Z | scripts/encode_renditions.py | cyberj0g/verification-classifier | efb19a3864e27a7f149a1c27ee8e13eaa19f96eb | [
"MIT"
] | 8 | 2019-02-28T11:21:46.000Z | 2022-03-21T07:34:20.000Z | import argparse
import subprocess
from os import makedirs
import multiprocessing
from utils import *
parser = argparse.ArgumentParser(description='Generate renditions')
parser.add_argument('-i', "--input", action='store', help='Folder where the 1080p renditions are', type=str,
required=True)
parser... | 37.255102 | 119 | 0.609422 |
8de8e4b49c9e50ba657e61e04647557e772e96af | 396 | py | Python | demo/Model/mongo_model.py | GritYolo/work | ee2b6e6aa545cf352d54ff7c2cc0d14fc68e2f3e | [
"Apache-2.0"
] | null | null | null | demo/Model/mongo_model.py | GritYolo/work | ee2b6e6aa545cf352d54ff7c2cc0d14fc68e2f3e | [
"Apache-2.0"
] | null | null | null | demo/Model/mongo_model.py | GritYolo/work | ee2b6e6aa545cf352d54ff7c2cc0d14fc68e2f3e | [
"Apache-2.0"
] | null | null | null | import sys
import os
import pymongo
from pymongo import MongoClient
class Mongo():
clent = None
db = None
collection = None
def makeConnection(self):
self.client = MongoClient('localhost',27017)
def getDatabase(self,dbName):
self.db = self.client[dbName]
return self.db
def getCollection(self,collectionN... | 18 | 46 | 0.755051 |
4fe6194029d47962eeec57c4e9a1e80b25a0a1d0 | 46,054 | py | Python | test/python/circuit/test_circuit_operations.py | t-imamichi/qiskit-core | 8d2eeeac44f97af1e10514cdae4157e5923ff2e5 | [
"Apache-2.0"
] | 92 | 2018-06-05T11:18:38.000Z | 2018-07-01T23:50:44.000Z | test/python/circuit/test_circuit_operations.py | t-imamichi/qiskit-core | 8d2eeeac44f97af1e10514cdae4157e5923ff2e5 | [
"Apache-2.0"
] | 107 | 2018-06-05T08:41:19.000Z | 2018-07-02T12:10:53.000Z | test/python/circuit/test_circuit_operations.py | declanmillar/qiskit-terra | 43e4a72c9c1537dd3d220a52f7e56423dfdd926c | [
"Apache-2.0"
] | 39 | 2018-06-05T09:55:56.000Z | 2018-07-02T08:47:35.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 37.381494 | 100 | 0.615907 |
c14b9101725df1fa97cb8bb93c1fe4b3cb0eafdb | 3,651 | py | Python | pcaptotxt.py | namnguyen2010/pcaptofigure | 366436a848382defced69e8a5ef4908a8177e585 | [
"MIT"
] | null | null | null | pcaptotxt.py | namnguyen2010/pcaptofigure | 366436a848382defced69e8a5ef4908a8177e585 | [
"MIT"
] | null | null | null | pcaptotxt.py | namnguyen2010/pcaptofigure | 366436a848382defced69e8a5ef4908a8177e585 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
pcaptolist
:license: MIT, see LICENSE for details.
"""
import sys
from subprocess import Popen, PIPE
from tshark import tshark
def pcaptolist(tshark_path, input_file):
res = '' # create empty string
# time_list=[]
# frlen_list=[]
# source_l... | 34.121495 | 109 | 0.554369 |
72d29e78ae84e370ecd882ccbf9536dccbe4bcb8 | 846 | py | Python | processtest.py | cleuton/NaiveFaceRecognizer | 4616e3c4b4e09f5a8475b7b2064abb6d6d5458bc | [
"Apache-2.0"
] | 1 | 2020-03-23T22:50:45.000Z | 2020-03-23T22:50:45.000Z | processtest.py | cleuton/NaiveFaceRecognizer | 4616e3c4b4e09f5a8475b7b2064abb6d6d5458bc | [
"Apache-2.0"
] | null | null | null | processtest.py | cleuton/NaiveFaceRecognizer | 4616e3c4b4e09f5a8475b7b2064abb6d6d5458bc | [
"Apache-2.0"
] | null | null | null | import pythonfaces
import cv2
import os
import sys
path_test="./test"
path_source="./test_source"
def process_file(fname):
faceslist = pythonfaces.imageFromFile(fname,img_h=512,img_w=512)
fcount=0
for bwimage in faceslist:
image = backtorgb = cv2.cvtColor(bwimage,cv2.COLOR_GRAY2RGB)
fcoun... | 32.538462 | 69 | 0.669031 |
4e476772fa1efda448814f8f8a0482b7a73a584a | 1,688 | py | Python | .history/Classiles/ice_cream_20210614182454.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | .history/Classiles/ice_cream_20210614182454.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | .history/Classiles/ice_cream_20210614182454.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | """[Practice: Ice Cream]
Class
keyword class name
class Ice:
Instantiation
variable class
name name
("instance")
ice = Ice()
Method an action or behavior ==== to add a method, I simply define a function inside the class
| method name is (eat)
def eat(... | 24.823529 | 109 | 0.558649 |
cf6203ef910cbb706facbad875dbce2f820a1602 | 1,088 | py | Python | plot3d.py | joekasp/spectro | 65ef111407cfdc4c69112e93fb04842fa15b615c | [
"MIT"
] | null | null | null | plot3d.py | joekasp/spectro | 65ef111407cfdc4c69112e93fb04842fa15b615c | [
"MIT"
] | null | null | null | plot3d.py | joekasp/spectro | 65ef111407cfdc4c69112e93fb04842fa15b615c | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
def surf3d(x,y,Z,window_title='Figure',ax_title='',fig='None',azim=-50,elev=25):
'''
Performs 3d surface plot for x,y,Z data
'''
X,Y = np.meshgrid(y,x)... | 29.405405 | 81 | 0.659007 |
76a3e5e63e25dbfdf8b883350d58e45a4f334541 | 8,325 | py | Python | ts3bot/commands/api_key.py | MrGunflame/teamspeak_bot | 0799c9d2177bf4a737b2ba12f8743cac981f8efa | [
"MIT"
] | null | null | null | ts3bot/commands/api_key.py | MrGunflame/teamspeak_bot | 0799c9d2177bf4a737b2ba12f8743cac981f8efa | [
"MIT"
] | null | null | null | ts3bot/commands/api_key.py | MrGunflame/teamspeak_bot | 0799c9d2177bf4a737b2ba12f8743cac981f8efa | [
"MIT"
] | null | null | null | import datetime
import logging
import typing
import ts3
import ts3bot
from requests import RequestException
from ts3bot import (
ApiErrBadData,
Config,
InvalidKeyException,
RateLimitException,
events,
fetch_api,
sync_groups,
)
from ts3bot.bot import Bot
from ts3bot.database import enums, mo... | 39.832536 | 113 | 0.479159 |
f4f2aba7a9127521eed4c78b8ab916e886637f98 | 1,949 | py | Python | repos/system_upgrade/el8toel9/actors/checkcustomnetworkscripts/libraries/customnetworkscripts.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 21 | 2018-11-20T15:58:39.000Z | 2022-03-15T19:57:24.000Z | repos/system_upgrade/el8toel9/actors/checkcustomnetworkscripts/libraries/customnetworkscripts.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 732 | 2018-11-21T18:33:26.000Z | 2022-03-31T16:16:24.000Z | repos/system_upgrade/el8toel9/actors/checkcustomnetworkscripts/libraries/customnetworkscripts.py | sm00th/leapp-repository | 1c171ec3a5f9260a3c6f84a9b15cad78a875ac61 | [
"Apache-2.0"
] | 85 | 2018-11-20T17:55:00.000Z | 2022-03-29T09:40:31.000Z | import os
from leapp import reporting
CUSTOM_NETWORK_SCRIPTS = [
"/sbin/ifup-local",
"/sbin/ifup-pre-local",
"/sbin/ifdown-local",
"/sbin/ifdown-pre-local",
]
DOC_URL = "https://red.ht/upgrading-RHEL-8-to-RHEL-9-network-scripts"
def generate_report(existing_custom_network_scripts):
""" Generate ... | 33.033898 | 87 | 0.6157 |
6e544566f262408a70a5450c205d507bdc678afd | 31,814 | py | Python | tests/unit/commands/local/lib/test_provider.py | praneetap/aws-sam-cli | 2a713566c8de72a68eb8954584674a61a2d807ac | [
"Apache-2.0"
] | 2,285 | 2017-08-11T16:57:31.000Z | 2018-05-08T20:38:25.000Z | tests/unit/commands/local/lib/test_provider.py | praneetap/aws-sam-cli | 2a713566c8de72a68eb8954584674a61a2d807ac | [
"Apache-2.0"
] | 314 | 2017-08-11T17:29:27.000Z | 2018-05-08T20:51:47.000Z | tests/unit/commands/local/lib/test_provider.py | praneetap/aws-sam-cli | 2a713566c8de72a68eb8954584674a61a2d807ac | [
"Apache-2.0"
] | 284 | 2017-08-11T17:35:48.000Z | 2018-05-08T20:15:59.000Z | import os
import posixpath
from unittest import TestCase
from unittest.mock import MagicMock, Mock, patch
from parameterized import parameterized, parameterized_class
from samcli.lib.utils.architecture import X86_64, ARM64
from samcli.lib.providers.provider import (
LayerVersion,
ResourceIdentifier,
Stac... | 37.828775 | 120 | 0.606808 |
1c602868b56b2fad4d4965acba83db8f7edb3f7d | 6,413 | py | Python | BingRewards/BingRewards.py | TheMercDeadpool/bing-rewards | 943bc4267ea956d5061dc197033ac34fd9dc5f6a | [
"MIT"
] | null | null | null | BingRewards/BingRewards.py | TheMercDeadpool/bing-rewards | 943bc4267ea956d5061dc197033ac34fd9dc5f6a | [
"MIT"
] | null | null | null | BingRewards/BingRewards.py | TheMercDeadpool/bing-rewards | 943bc4267ea956d5061dc197033ac34fd9dc5f6a | [
"MIT"
] | null | null | null | import sys
import os
from src.rewards import Rewards
from src.log import HistLog
import logging
DRIVERS_DIR = "drivers"
DRIVER = "chromedriver"
LOG_DIR = "logs"
ERROR_LOG = "error.log"
RUN_LOG = "run.log"
SEARCH_LOG ... | 43.331081 | 187 | 0.587401 |
fa32d81434dd592e7d60be4c654bb5e606ba452a | 1,318 | py | Python | mikrotik_config_capture.py | orgito/ncm-scripts | 7ce0a1cdd783f06d41633357c712c6addebc7702 | [
"MIT"
] | 6 | 2018-08-31T23:08:36.000Z | 2021-07-29T13:12:59.000Z | mikrotik_config_capture.py | orgito/ncm-scripts | 7ce0a1cdd783f06d41633357c712c6addebc7702 | [
"MIT"
] | null | null | null | mikrotik_config_capture.py | orgito/ncm-scripts | 7ce0a1cdd783f06d41633357c712c6addebc7702 | [
"MIT"
] | 2 | 2020-03-19T17:51:17.000Z | 2021-08-03T08:38:24.000Z | #!/usr/bin/python3
"""
Capture MikroTik device configurations. Used by CA Spectrum NCM.
"""
import argparse
import re
from time import sleep
import paramiko
parser = argparse.ArgumentParser(description='Capture MikroTik configurations')
parser.add_argument('host', type=str, help='Device ip address')
parser.add_argum... | 28.652174 | 128 | 0.748103 |
19b66c06fd111ebecc88db08dba38800812570fb | 1,232 | py | Python | examples/rosenbrock_anneal.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | examples/rosenbrock_anneal.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | examples/rosenbrock_anneal.py | zhanglei1172/XBBO | 9bf9b778b29735f108457d5e491680785212d580 | [
"MIT"
] | null | null | null | import numpy as np
from xbbo.search_space.fast_example_problem import build_space, rosenbrock_2d
from xbbo.search_algorithm.anneal_optimizer import Anneal
from xbbo.utils.constants import MAXINT
if __name__ == "__main__":
MAX_CALL = 1000
rng = np.random.RandomState(42)
# define black box function
bl... | 32.421053 | 116 | 0.684253 |
bc6939c09c61eb3e6f070ef2bb17da8eaeb402a3 | 1,181 | py | Python | looking_for_group/game_catalog/migrations/0009_auto_20181104_1033.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | looking_for_group/game_catalog/migrations/0009_auto_20181104_1033.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | looking_for_group/game_catalog/migrations/0009_auto_20181104_1033.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.1.2 on 2018-11-04 15:33
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('game_catalog', '0008_auto_20181104_0934'),
]
operations = [
migrations.AlterField(
model_name='... | 39.366667 | 219 | 0.666384 |
e0fb1ba66250e962774a5daaad553efc7ab19f19 | 550 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/frontline-safety-32038 | 2a116807444c92d75c3bda1f99b9042cc637ace5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/frontline-safety-32038 | 2a116807444c92d75c3bda1f99b9042cc637ace5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/frontline-safety-32038 | 2a116807444c92d75c3bda1f99b9042cc637ace5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "frontline-safety-32038.botics.co"
site_params = {
"name": "Frontline Safety",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.... | 21.153846 | 61 | 0.661818 |
52324a0ee62e491988085faee2c3946320eb9935 | 2,520 | py | Python | venv/lib/python3.8/site-packages/dateparser/data/numeral_translation_data/kl.py | yuta-komura/vishnu | 67173b674d5f4f3be189474103612447ef69ab44 | [
"MIT"
] | 1 | 2021-11-17T04:55:14.000Z | 2021-11-17T04:55:14.000Z | dateparser/data/numeral_translation_data/kl.py | cool-RR/dateparser | c38336df521cc57d947dc2c9111539a72f801652 | [
"BSD-3-Clause"
] | null | null | null | dateparser/data/numeral_translation_data/kl.py | cool-RR/dateparser | c38336df521cc57d947dc2c9111539a72f801652 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
info = {
"%%numbertimes": {
"1": "ataaseq;",
"2": "marlunnik;",
"3": "pingasunik;",
"4": "sisamanik;",
"5": "tallimanik;",
"6": "arfinilinnik;",
"7": "arfineq-marlunnik;",
"8": "arfineq-pingasunik;",
"9": "arfineq-sisama... | 36 | 88 | 0.475397 |
d8c62669708935c094688b05771d22290074d9dd | 335 | py | Python | fixpol/migrations/0011_auto_20200805_1926.py | tnadams/fix-politics | f2e82112063f95da81676bcf5f2bf4d8bf94d74b | [
"Apache-2.0"
] | null | null | null | fixpol/migrations/0011_auto_20200805_1926.py | tnadams/fix-politics | f2e82112063f95da81676bcf5f2bf4d8bf94d74b | [
"Apache-2.0"
] | null | null | null | fixpol/migrations/0011_auto_20200805_1926.py | tnadams/fix-politics | f2e82112063f95da81676bcf5f2bf4d8bf94d74b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.8 on 2020-08-05 19:26
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('fixpol', '0010_searchcriteria'),
]
operations = [
migrations.RenameModel(
old_name='SearchCriteria',
new_name='Criteria',
... | 18.611111 | 47 | 0.6 |
1f9fb96cb7aeb6a2c73c49845005f080aa3153e2 | 10,924 | py | Python | intersight/model/techsupportmanagement_collection_control_policy_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/techsupportmanagement_collection_control_policy_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/techsupportmanagement_collection_control_policy_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 53.029126 | 1,678 | 0.647657 |
cb8e6fe32faa4a29bdd918edca7876736eea8c8e | 290 | py | Python | api/rest.py | rbaylon/flask-restapi | 420fb90a5971e999bfbd3064c86efc960c25f21e | [
"BSD-2-Clause"
] | null | null | null | api/rest.py | rbaylon/flask-restapi | 420fb90a5971e999bfbd3064c86efc960c25f21e | [
"BSD-2-Clause"
] | null | null | null | api/rest.py | rbaylon/flask-restapi | 420fb90a5971e999bfbd3064c86efc960c25f21e | [
"BSD-2-Clause"
] | null | null | null | from flask_restful import Api
from api.resources import Room, RoomList, ApiLogin
from baseapp import app
rest_api = Api(app)
# Build api routes
rest_api.add_resource(RoomList, '/api/rooms')
rest_api.add_resource(Room, '/api/rooms/<room_id>')
rest_api.add_resource(ApiLogin, '/api/login')
| 26.363636 | 51 | 0.782759 |
ecc750e62ee1e576f8e197942e29186ac3b5e4e6 | 3,247 | py | Python | dvc/command/checkout.py | gucharbon/dvc | 3ec0e9b96492af5b89c683c912ba233afe81d7c2 | [
"Apache-2.0"
] | null | null | null | dvc/command/checkout.py | gucharbon/dvc | 3ec0e9b96492af5b89c683c912ba233afe81d7c2 | [
"Apache-2.0"
] | null | null | null | dvc/command/checkout.py | gucharbon/dvc | 3ec0e9b96492af5b89c683c912ba233afe81d7c2 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import operator
import colorama
from dvc.command import completion
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import CheckoutError
from dvc.utils.humanize import get_summary
logger = logging.getLogger(__name__)
def log_changes(stats):
colors = [
... | 27.285714 | 71 | 0.57376 |
d8430cf41a70f7893d5f9c07360e8e0379b1e92b | 2,319 | py | Python | LightLockClean/a1_Program-Files/b3_Static2/c3_Extract/d1_triangulateRobot.py | Team766/LightLock | b73250f084546749e25eb6446892641eab315725 | [
"Unlicense"
] | null | null | null | LightLockClean/a1_Program-Files/b3_Static2/c3_Extract/d1_triangulateRobot.py | Team766/LightLock | b73250f084546749e25eb6446892641eab315725 | [
"Unlicense"
] | null | null | null | LightLockClean/a1_Program-Files/b3_Static2/c3_Extract/d1_triangulateRobot.py | Team766/LightLock | b73250f084546749e25eb6446892641eab315725 | [
"Unlicense"
] | null | null | null | import math
PI = 3.141592653
def generatePointTwo(t1,tangent): #Creates a second point based off of heading
#Takes in first point as (x,y) tuple, and heading in radians
t1_1 = t1[0]
t1_2 = t1[1]
t1out = t1_1 +1
t2out = t1_2 - tangent
degreesToRadians(60)
return (t1out,t2out)
def find... | 30.116883 | 123 | 0.725313 |
beda100656e93a797facc3751b41918394a8f6d9 | 3,849 | py | Python | Hood/settings.py | iankurao/neighbourhood | 5c9384fa9496f75f734e83275ffc2865879a148b | [
"MIT"
] | null | null | null | Hood/settings.py | iankurao/neighbourhood | 5c9384fa9496f75f734e83275ffc2865879a148b | [
"MIT"
] | 5 | 2020-06-05T21:42:55.000Z | 2021-09-08T01:06:08.000Z | hood/settings.py | OlooOuma/mtaani | 8ba847e6df189bc06ab3bb2ae2f267b20507aed4 | [
"MIT"
] | null | null | null | """
Django settings for Hood project.
Generated by 'django-admin startproject' using Django 1.11.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
imp... | 24.993506 | 91 | 0.686412 |
bfa2b3c6445f1af5f35bdaf73935d31646d7fe8f | 845 | py | Python | neuralmonkey/evaluators/edit_distance.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | 15 | 2018-04-11T09:18:09.000Z | 2021-03-12T03:04:20.000Z | neuralmonkey/evaluators/edit_distance.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | null | null | null | neuralmonkey/evaluators/edit_distance.py | Simon-Will/neuralmonkey | b686a9d302cb10eda5fca991e1d7ee6b9e84b75a | [
"BSD-3-Clause"
] | 6 | 2017-07-25T15:30:28.000Z | 2019-10-31T16:14:48.000Z | from typing import List
from difflib import SequenceMatcher
import numpy as np
class EditDistanceEvaluator(object):
def __init__(self, name: str = "Edit distance") -> None:
self.name = name
def __call__(self, decoded: List[List[str]],
references: List[List[str]]) -> float:
r... | 29.137931 | 78 | 0.631953 |
23e36fd42fa35d6074ebd5de07ab202d56027104 | 3,184 | py | Python | server/parsing/PingResultParser.py | stephenmac98/cheesepi_python3 | d894117938deee8ba676d9872bed5eae388310d1 | [
"Apache-2.0"
] | 6 | 2019-11-28T20:41:15.000Z | 2022-03-03T10:40:10.000Z | server/parsing/PingResultParser.py | stephenmac98/cheesepi_python3 | d894117938deee8ba676d9872bed5eae388310d1 | [
"Apache-2.0"
] | 5 | 2016-07-11T16:43:43.000Z | 2022-03-03T10:40:54.000Z | server/parsing/PingResultParser.py | stephenmac98/cheesepi_python3 | d894117938deee8ba676d9872bed5eae388310d1 | [
"Apache-2.0"
] | 6 | 2016-07-11T16:40:20.000Z | 2020-09-06T13:16:09.000Z | from __future__ import unicode_literals, absolute_import, print_function
import logging
from .ResultParser import ResultParser
from cheesepi.server.storage.mongo import MongoDAO
from cheesepi.server.storage.models.result import Result
class PingResultParser(ResultParser):
log = logging.getLogger("cheesepi.server.p... | 30.615385 | 72 | 0.695038 |
b535344332cf925773706f8bf260499b3235118a | 7,698 | py | Python | smqtk_detection/utils/bbox.py | schencej/SMQTK-Detection | 7a5ccb6e3d772d589a39b02cbeaf01124c600b78 | [
"BSD-3-Clause"
] | 3 | 2021-08-06T13:01:08.000Z | 2021-12-10T20:17:30.000Z | smqtk_detection/utils/bbox.py | schencej/SMQTK-Detection | 7a5ccb6e3d772d589a39b02cbeaf01124c600b78 | [
"BSD-3-Clause"
] | 17 | 2021-08-19T14:18:52.000Z | 2022-03-25T20:53:25.000Z | smqtk_detection/utils/bbox.py | schencej/SMQTK-Detection | 7a5ccb6e3d772d589a39b02cbeaf01124c600b78 | [
"BSD-3-Clause"
] | 4 | 2021-08-19T13:49:29.000Z | 2022-02-02T17:51:13.000Z | import functools
import operator
import numpy
from smqtk_core import Plugfigurable
from typing import Type, Union, Optional, Sequence
class AxisAlignedBoundingBox (Plugfigurable):
"""
Representation of an axis-aligned rectangular region within N-dimensional
euclidean space.
AxisAlignedBoundingBox ... | 39.27551 | 113 | 0.616134 |
56793f8ccaaf73dd4f4bceecb8347e7ab2153c64 | 255 | py | Python | jp.atcoder/abc104/abc104_b/27959017.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc104/abc104_b/27959017.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc104/abc104_b/27959017.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import typing
def main() -> typing.NoReturn:
s = input()
t = s.lower()
ok = True
ok &= sum(s[i] != t[i] for i in range(len(s))) == 2
ok &= s[0] == "A"
ok &= "C" in s[2:-1]
print("AC" if ok else "WA")
main()
| 15.9375 | 56 | 0.435294 |
414ba43c341bdbe20964e24e2203da0434d0b584 | 1,267 | py | Python | api/app01/migrations/0001_initial.py | borko81/django_rest_api | bd98471eb0705e203bda6841143da0a65026e2b4 | [
"MIT"
] | null | null | null | api/app01/migrations/0001_initial.py | borko81/django_rest_api | bd98471eb0705e203bda6841143da0a65026e2b4 | [
"MIT"
] | null | null | null | api/app01/migrations/0001_initial.py | borko81/django_rest_api | bd98471eb0705e203bda6841143da0a65026e2b4 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-09-18 18:40
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='University',
fields=[
... | 31.675 | 118 | 0.550908 |
165aefa21ec05bf6dc29dbaea8bd9509a85a4d01 | 386 | py | Python | tests/system_tests/test_verifiers/test_babsb.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 5 | 2022-01-28T20:30:34.000Z | 2022-03-17T09:26:52.000Z | tests/system_tests/test_verifiers/test_babsb.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 9 | 2022-01-27T03:50:28.000Z | 2022-02-08T18:42:17.000Z | tests/system_tests/test_verifiers/test_babsb.py | samysweb/dnnv | 58fb95b7300914d9da28eed86c39eca473b1aaef | [
"MIT"
] | 2 | 2022-02-03T17:32:43.000Z | 2022-03-24T16:38:49.000Z | import unittest
from dnnv.verifiers.babsb import BaBSB
from system_tests.test_verifiers.utils import VerifierTests
@unittest.skipIf(not BaBSB.is_installed(), "BaBSB is not installed")
class BaBSBVerifierTests(VerifierTests, unittest.TestCase):
def initialize(self):
self.verifier = BaBSB
self.is_... | 22.705882 | 68 | 0.751295 |
5e07788c09c2dbd75ffa3a15ab0032687c13619b | 444 | py | Python | hour.py | PhoenixNil/pythoncode | bbb49884588ef9671c96961235be450158ea9496 | [
"bzip2-1.0.6"
] | null | null | null | hour.py | PhoenixNil/pythoncode | bbb49884588ef9671c96961235be450158ea9496 | [
"bzip2-1.0.6"
] | null | null | null | hour.py | PhoenixNil/pythoncode | bbb49884588ef9671c96961235be450158ea9496 | [
"bzip2-1.0.6"
] | null | null | null | name = input("Enter file:")
if len(name) < 1 : name = "mbox-short.txt"
handle = open(name)
distribution=dict()
hours=list()
temp=list()
for line in handle :
if not line.startswith('From ') : continue
words=line.split()
time=words[5]
hour=time.split(':')
hours.append(hour[0])
for number in hours :
... | 27.75 | 56 | 0.63964 |
41d693cb6059ee4c8f85127bbb61e14ea1abd315 | 8,056 | py | Python | AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py | TheKeaver/o3de | 3791149c6bb18d007ee375f592bdd031871f793d | [
"Apache-2.0",
"MIT"
] | 1 | 2021-08-11T02:20:46.000Z | 2021-08-11T02:20:46.000Z | AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py | RoddieKieley/o3de | e804fd2a4241b039a42d9fa54eaae17dc94a7a92 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/automatedtesting_shared/base.py | RoddieKieley/o3de | e804fd2a4241b039a42d9fa54eaae17dc94a7a92 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import logging
import subprocess
import pytest
import time
import ly_test_tools.environment.file_sy... | 41.102041 | 183 | 0.602036 |
acc1ede494453a50d9014c18c2b27ca456960b39 | 651 | py | Python | tests/test_cell_edges.py | kbsezginel/angstrom | 793fd05b9bf27cab50d5c292fe63f685ea767d6d | [
"BSD-3-Clause"
] | 15 | 2018-04-26T18:34:02.000Z | 2022-01-25T09:37:35.000Z | tests/test_cell_edges.py | kbsezginel/angstrom | 793fd05b9bf27cab50d5c292fe63f685ea767d6d | [
"BSD-3-Clause"
] | 13 | 2018-07-31T17:26:10.000Z | 2020-05-15T05:07:05.000Z | tests/test_cell_edges.py | kbsezginel/angstrom | 793fd05b9bf27cab50d5c292fe63f685ea767d6d | [
"BSD-3-Clause"
] | 4 | 2020-01-15T08:31:54.000Z | 2022-03-03T16:43:15.000Z | """
--- Ångström ---
Tests cell edges calculation.
"""
from angstrom.molecule import Cell
import numpy as np
def test_cubic_unit_cell_edges_calculation():
a, b, c = 5, 5, 5
expected_edges = [[[a, 0, 0], [0, 0, 0]], [[0, b, 0], [0, 0, 0]], [[0, 0, c], [0, 0, 0]],
[[a, b, 0], [a, 0, 0]], [... | 38.294118 | 93 | 0.414747 |
c9d5542c6aefb01533d1b46309c76e04a50cc3f8 | 184 | py | Python | pyobs/utils/skyflats/priorities/__init__.py | pyobs/pyobs-core | e3401e63eb31587c2bc535f7346b7e4ef69d64ab | [
"MIT"
] | 4 | 2020-02-14T10:50:03.000Z | 2022-03-25T04:15:06.000Z | pyobs/utils/skyflats/priorities/__init__.py | pyobs/pyobs-core | e3401e63eb31587c2bc535f7346b7e4ef69d64ab | [
"MIT"
] | 60 | 2020-09-14T09:10:20.000Z | 2022-03-25T17:51:42.000Z | pyobs/utils/skyflats/priorities/__init__.py | pyobs/pyobs-core | e3401e63eb31587c2bc535f7346b7e4ef69d64ab | [
"MIT"
] | 2 | 2020-10-14T09:34:57.000Z | 2021-04-27T09:35:57.000Z | """
TODO: write docs
"""
__title__ = 'Sky flat priorities'
from .base import SkyflatPriorities
from .archive import ArchiveSkyflatPriorities
from .const import ConstSkyflatPriorities
| 20.444444 | 45 | 0.804348 |
e7a5a4e86e5e696c8ebfd2d18eaa839678d6d23d | 183,498 | py | Python | session_py/iginx/thrift/rpc/ttypes.py | thulab/IginX | 8b80e089b4e419c46496a8ab1d1217aff6813c8d | [
"Apache-2.0"
] | 16 | 2021-03-08T07:03:57.000Z | 2022-03-24T21:31:44.000Z | session_py/iginx/thrift/rpc/ttypes.py | thulab/IginX | 8b80e089b4e419c46496a8ab1d1217aff6813c8d | [
"Apache-2.0"
] | 38 | 2021-03-19T06:10:51.000Z | 2022-01-21T03:34:46.000Z | session_py/iginx/thrift/rpc/ttypes.py | thulab/IginX | 8b80e089b4e419c46496a8ab1d1217aff6813c8d | [
"Apache-2.0"
] | 13 | 2021-03-08T07:09:24.000Z | 2022-02-22T12:28:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.196919 | 356 | 0.555962 |
5f4b79d73428df22d6f1f27b9989096cbe48ed3c | 9,408 | py | Python | gccutils/asyncscrapers/adviseescraper.py | redParrot17/mygcc-utils | 6ef163d71c2697c3e42272a730314796082fc6fc | [
"MIT"
] | 1 | 2021-02-12T19:46:56.000Z | 2021-02-12T19:46:56.000Z | gccutils/asyncscrapers/adviseescraper.py | redParrot17/mygcc-utils | 6ef163d71c2697c3e42272a730314796082fc6fc | [
"MIT"
] | null | null | null | gccutils/asyncscrapers/adviseescraper.py | redParrot17/mygcc-utils | 6ef163d71c2697c3e42272a730314796082fc6fc | [
"MIT"
] | null | null | null | from gccutils.asyncscrapers.scrapersession import AsyncScraperManager, AsyncScraperSession
import gccutils.errors as errors
import traceback
import uuid
import time
__all__ = ('AsyncAdviseeScraper',)
class AdviseeOverviewParser:
"""A helper class for parsing data from an advisee overview page."""
LEFT_TABL... | 34.973978 | 107 | 0.620217 |
04e3bd2e18176e822c743d3c7d206766b9a32c64 | 2,184 | py | Python | src/cfnlint/rules/functions/RefInCondition.py | mvanholsteijn/cfn-python-lint | cddd272db852c0ceec39a873430a84559a1ac48d | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/functions/RefInCondition.py | mvanholsteijn/cfn-python-lint | cddd272db852c0ceec39a873430a84559a1ac48d | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/functions/RefInCondition.py | mvanholsteijn/cfn-python-lint | cddd272db852c0ceec39a873430a84559a1ac48d | [
"MIT-0"
] | null | null | null | """
Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to ... | 46.468085 | 144 | 0.704212 |
6f0087602416439330a3833b8747439fc692b1f0 | 7,049 | py | Python | packages/python/plotly/plotly/graph_objs/parcoords/line/colorbar/_title.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/parcoords/line/colorbar/_title.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/parcoords/line/colorbar/_title.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "parcoords.line.colorbar"
_path_str = "parcoords.line.colorbar.title"
_valid_props = {"font", ... | 33.407583 | 88 | 0.544474 |
2bd544fc77148442e0a95691e3d7c8403f6f1082 | 7,860 | py | Python | course2/run_log.py | uofon-shaowen/SummerCourse2021 | f3b4d3ef947190b42cf675ce4b17d6fbcf1f9da0 | [
"MIT"
] | 28 | 2021-08-12T09:36:54.000Z | 2022-02-08T09:19:40.000Z | course2/run_log.py | uofon-shaowen/SummerCourse2021 | f3b4d3ef947190b42cf675ce4b17d6fbcf1f9da0 | [
"MIT"
] | 2 | 2021-08-22T11:49:53.000Z | 2021-08-25T02:31:53.000Z | course2/run_log.py | uofon-shaowen/SummerCourse2021 | f3b4d3ef947190b42cf675ce4b17d6fbcf1f9da0 | [
"MIT"
] | 22 | 2021-08-16T12:23:13.000Z | 2021-12-02T07:58:09.000Z | # -*- coding:utf-8 -*-
import os
import time
import json
import numpy as np
from env.chooseenv import make
from utils.get_logger import get_logger
from env.obs_interfaces.observation import obs_type
import argparse
class NpEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer... | 41.151832 | 118 | 0.652926 |
781483c6265554a4415ac89ba155875a0d6dbf31 | 8,209 | py | Python | scripts/healthy_levels_plot.py | always-newbie161/pyprobml | eb70c84f9618d68235ef9ba7da147c009b2e4a80 | [
"MIT"
] | 2 | 2021-02-26T04:36:10.000Z | 2021-02-26T04:36:24.000Z | scripts/healthy_levels_plot.py | always-newbie161/pyprobml | eb70c84f9618d68235ef9ba7da147c009b2e4a80 | [
"MIT"
] | 1 | 2021-04-22T15:46:27.000Z | 2021-04-22T15:46:27.000Z | scripts/healthy_levels_plot.py | always-newbie161/pyprobml | eb70c84f9618d68235ef9ba7da147c009b2e4a80 | [
"MIT"
] | 1 | 2021-06-21T01:18:07.000Z | 2021-06-21T01:18:07.000Z | # Based on https://github.com/probml/pmtk3/blob/master/demos/healthyLevels.m
# Converted by John Fearns - jdf22@infradead.org
# Josh Tenenbaum's Healthy Levels game
import numpy as np
import matplotlib.pyplot as plt
#from pyprobml_utils import save_fig
# Ensure stochastic reproducibility.
np.random.seed(11)
... | 39.277512 | 125 | 0.625655 |
2a6cd0094f6cc9c57ed8a856fffb57bc1f1f0f4b | 3,898 | py | Python | Compiler/GC/instructions.py | asifmallik/SCALE-MAMBA | 80db831818b55b7675dd549920b5fb096db4321f | [
"BSD-2-Clause"
] | 196 | 2018-05-25T11:41:56.000Z | 2022-03-12T05:49:50.000Z | Compiler/GC/instructions.py | asifmallik/SCALE-MAMBA | 80db831818b55b7675dd549920b5fb096db4321f | [
"BSD-2-Clause"
] | 49 | 2018-07-17T15:49:41.000Z | 2021-01-19T11:35:31.000Z | Compiler/GC/instructions.py | athenarc/SCALE-MAMBA | 18fa886d820bec7e441448357b8f09e2be0e7c9e | [
"BSD-2-Clause"
] | 90 | 2018-05-25T11:41:42.000Z | 2022-03-23T19:15:10.000Z | import Compiler.instructions_base as base
import Compiler.instructions as spdz
import Compiler.tools as tools
import collections
import itertools
class SecretBitsAF(base.RegisterArgFormat):
reg_type = 'sb'
class ClearBitsAF(base.RegisterArgFormat):
reg_type = 'cb'
base.ArgFormats['sb'] = SecretBitsAF
base.Arg... | 26.517007 | 70 | 0.659569 |
8014fe7ed2db49038d25513b45b94428e256e0af | 3,783 | py | Python | autofit/aggregator/search_output.py | caoxiaoyue/PyAutoFit | 819cd2acc8d4069497a161c3bb6048128e44d828 | [
"MIT"
] | 39 | 2019-01-24T10:45:23.000Z | 2022-03-18T09:37:59.000Z | autofit/aggregator/search_output.py | caoxiaoyue/PyAutoFit | 819cd2acc8d4069497a161c3bb6048128e44d828 | [
"MIT"
] | 260 | 2018-11-27T12:56:33.000Z | 2022-03-31T16:08:59.000Z | autofit/aggregator/search_output.py | caoxiaoyue/PyAutoFit | 819cd2acc8d4069497a161c3bb6048128e44d828 | [
"MIT"
] | 13 | 2018-11-30T16:49:05.000Z | 2022-01-21T17:39:29.000Z | import logging
import os
import pickle
from os import path
import dill
from autofit.non_linear import abstract_search
original_create_file_handle = dill._dill._create_filehandle
def _create_file_handle(*args, **kwargs):
"""
Handle FileNotFoundError when attempting to deserialize pickles
... | 27.413043 | 101 | 0.532382 |
e14ccf01738717bc0e428f1f81aced5151fb251a | 8,382 | py | Python | salt/log/handlers/__init__.py | The-Loeki/salt | 8ff8212cc1eacfe409eb9cc017b21250f28dd305 | [
"Apache-2.0"
] | 1 | 2017-08-30T12:19:40.000Z | 2017-08-30T12:19:40.000Z | salt/log/handlers/__init__.py | The-Loeki/salt | 8ff8212cc1eacfe409eb9cc017b21250f28dd305 | [
"Apache-2.0"
] | null | null | null | salt/log/handlers/__init__.py | The-Loeki/salt | 8ff8212cc1eacfe409eb9cc017b21250f28dd305 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
salt.log.handlers
~~~~~~~~~~~~~~~~~
.. versionadded:: 0.17.0
Custom logging handlers to be used in salt.
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python libs
import sys
import logging
import threading
import collections
import l... | 35.820513 | 136 | 0.620138 |
c1703d422887c270ff0a1f839f28a014dab4561f | 425 | py | Python | inputs/migrations/0002_baser_science.py | rkeaveny/django_kelvakis_site | 21c6c303dbecc5e7922407ec386b330eb51e9e8a | [
"MIT"
] | 1 | 2018-04-14T19:50:08.000Z | 2018-04-14T19:50:08.000Z | inputs/migrations/0002_baser_science.py | rkeaveny/django_kelvakis_site | 21c6c303dbecc5e7922407ec386b330eb51e9e8a | [
"MIT"
] | null | null | null | inputs/migrations/0002_baser_science.py | rkeaveny/django_kelvakis_site | 21c6c303dbecc5e7922407ec386b330eb51e9e8a | [
"MIT"
] | null | null | null | # Generated by Django 2.0.3 on 2018-03-27 18:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inputs', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='baser',
name='science',
fiel... | 21.25 | 67 | 0.588235 |
9b7a91662eec11b98b9712535c146d8e3b7ef845 | 9,203 | py | Python | configurations/j3_single_slice5b.py | ShuaiW/kaggle-heart | 022997f27add953c74af2b371c67d9d86cbdccc3 | [
"MIT"
] | 182 | 2016-03-15T01:51:29.000Z | 2021-04-21T09:49:05.000Z | configurations/j3_single_slice5b.py | weidezhang/kaggle-heart | 022997f27add953c74af2b371c67d9d86cbdccc3 | [
"MIT"
] | 1 | 2018-06-22T16:46:12.000Z | 2018-06-22T21:08:09.000Z | configurations/j3_single_slice5b.py | weidezhang/kaggle-heart | 022997f27add953c74af2b371c67d9d86cbdccc3 | [
"MIT"
] | 61 | 2016-03-15T00:58:28.000Z | 2020-03-06T22:00:41.000Z | from deep_learning_layers import ConvolutionOver2DAxisLayer, MaxPoolOverAxisLayer, MaxPoolOver2DAxisLayer, \
MaxPoolOver3DAxisLayer, ConvolutionOver3DAxisLayer, ConvolutionOverAxisLayer
from default import *
import theano.tensor as T
from layers import MuLogSigmaErfLayer, CumSumLayer
import objectives
from lasagn... | 44.245192 | 148 | 0.545692 |
c4813d00a8c2b91570d69b0787a9666e4b348aaf | 20,239 | py | Python | tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py | shoamano83/sdl_core | ea5960280585d11ee02542b0ab183d4400ed691d | [
"BSD-3-Clause"
] | null | null | null | tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py | shoamano83/sdl_core | ea5960280585d11ee02542b0ab183d4400ed691d | [
"BSD-3-Clause"
] | null | null | null | tools/InterfaceGenerator/test/generator/generators/test_SmartFactoryJSONRPC.py | shoamano83/sdl_core | ea5960280585d11ee02542b0ab183d4400ed691d | [
"BSD-3-Clause"
] | 1 | 2020-04-22T07:17:49.000Z | 2020-04-22T07:17:49.000Z | """Test for JSONRPC SmartFactory generator.
Verifies format specific functions and produced source code.
"""
import collections
import codecs
import os
import unittest
import uuid
from mock import MagicMock
from mock import call
from generator.generators import SmartFactoryJSONRPC
from generator import Model
EXPE... | 41.902692 | 79 | 0.585306 |
8100c5f593e505ab127c39e97f46fc20cf87aab8 | 751 | py | Python | queryset_client/tests/base/tests/create.py | pulina/tastypie-queryset-client | 1d65ee387e256b78c44fd8be57fa64ca798ae2da | [
"MIT"
] | null | null | null | queryset_client/tests/base/tests/create.py | pulina/tastypie-queryset-client | 1d65ee387e256b78c44fd8be57fa64ca798ae2da | [
"MIT"
] | 1 | 2016-12-22T10:55:44.000Z | 2016-12-22T10:55:44.000Z | queryset_client/tests/base/tests/create.py | pulina/tastypie-queryset-client | 1d65ee387e256b78c44fd8be57fa64ca798ae2da | [
"MIT"
] | 5 | 2015-04-27T11:50:28.000Z | 2019-01-10T06:39:57.000Z | #from django.conf import settings
#settings.DEBUG = True
from testcases import (
TestServerTestCase,
get_client
)
class CreateTestCase(TestServerTestCase):
def setUp(self):
self.start_test_server()
self.client = get_client()
def tearDown(self):
self.stop_test_server()
def ... | 30.04 | 93 | 0.681758 |
43a3c69cd3431cae099684b2dc59d43c4444c24f | 2,414 | py | Python | rlkit/torch/networks/two_headed_mlp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | rlkit/torch/networks/two_headed_mlp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | rlkit/torch/networks/two_headed_mlp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | from torch import nn as nn
from torch.nn import functional as F
from rlkit.pythonplusplus import identity
from rlkit.torch import pytorch_util as ptu
from rlkit.torch.core import PyTorchModule
from rlkit.torch.networks.experimental import LayerNorm
class TwoHeadMlp(PyTorchModule):
def __init__(
self,... | 33.527778 | 68 | 0.623447 |
7d891fe672ad05960c0fe5ee18bbe72c69135096 | 2,192 | py | Python | Respaldo/package_fetch/src/nodo_detect_obstacles_v3.py | Tachuelin/RMA-Dedutel | 796add66dc20efe8205055a648c01a5a5de194ad | [
"MIT"
] | 1 | 2022-03-30T22:29:33.000Z | 2022-03-30T22:29:33.000Z | Respaldo/package_fetch/src/nodo_detect_obstacles_v3.py | Tachuelin/RMA-Dedutel | 796add66dc20efe8205055a648c01a5a5de194ad | [
"MIT"
] | null | null | null | Respaldo/package_fetch/src/nodo_detect_obstacles_v3.py | Tachuelin/RMA-Dedutel | 796add66dc20efe8205055a648c01a5a5de194ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
#Linea 1 - “Shebang”,le indicamos a la máquina con qué programa lo vamos a ejecutar.
#Linea 2 - Python 3 - asume que solo se utiliza ASCII en el código fuente
# para usar utf-8 hay que indicarlo al principio de nuestro script encoding: utf-8
import rospy ... | 44.734694 | 158 | 0.5625 |
c3543dc9945dd8cc2c09804832190aced100471c | 12,100 | py | Python | mog/__init__.py | x10an14/mog | be29e122f33c45d78d37377a6c86d6b2034688e6 | [
"MIT"
] | null | null | null | mog/__init__.py | x10an14/mog | be29e122f33c45d78d37377a6c86d6b2034688e6 | [
"MIT"
] | null | null | null | mog/__init__.py | x10an14/mog | be29e122f33c45d78d37377a6c86d6b2034688e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import os
import os.path
try:
import ConfigParser as configparser
except ImportError:
import configparser
try:
from pipes import quote
except ImportError:
from shlex import quote
import sys
import re
import subprocess
from functools import par... | 33.611111 | 126 | 0.600661 |
8e6a7c927b08ffd73a6488e07887951d342ea2db | 340 | py | Python | decompress-run-length-encoded-list/decompress-run-length-encoded-list.py | shaurya-src/code-leet | f642b81eb7bead46c66404bd48ca74bdfeb2abbb | [
"MIT"
] | null | null | null | decompress-run-length-encoded-list/decompress-run-length-encoded-list.py | shaurya-src/code-leet | f642b81eb7bead46c66404bd48ca74bdfeb2abbb | [
"MIT"
] | null | null | null | decompress-run-length-encoded-list/decompress-run-length-encoded-list.py | shaurya-src/code-leet | f642b81eb7bead46c66404bd48ca74bdfeb2abbb | [
"MIT"
] | null | null | null | class Solution:
def decompressRLElist(self, nums: List[int]) -> List[int]:
op = []
cf = nums[0]
i = 1
while i <= (len(nums)):
try:
op.extend([nums[i]]*cf)
cf = nums[i+1]
i+=2
except Exception:
bre... | 26.153846 | 62 | 0.397059 |
63c2e1a43e9e8d4c3a628dd98a48f2de0ddb52a5 | 1,372 | py | Python | lib/galaxy/util/monitors.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/util/monitors.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/util/monitors.py | mmiladi/galaxy | 7857b152cd10d9490ac2433ff2905ca1a47ee32c | [
"CC-BY-3.0"
] | null | null | null | from __future__ import absolute_import
import logging
import threading
from .sleeper import Sleeper
log = logging.getLogger(__name__)
DEFAULT_MONITOR_THREAD_JOIN_TIMEOUT = 5
class Monitors:
def _init_monitor_thread(self, name, target_name=None, target=None, start=False, config=None):
self.monitor_joi... | 30.488889 | 117 | 0.687318 |
5dbec7ef4259340069bc1ed0adffa9ffab8e3a4a | 1,177 | py | Python | tools/mapred/reducer.py | EMinsight/Silo | a1e27d34e8b52196be2de3d4aae2d0cae21b3f36 | [
"Apache-2.0"
] | 8 | 2021-10-08T00:22:19.000Z | 2022-03-21T02:17:31.000Z | tools/mapred/reducer.py | EMinsight/Silo | a1e27d34e8b52196be2de3d4aae2d0cae21b3f36 | [
"Apache-2.0"
] | 184 | 2019-03-20T03:02:33.000Z | 2019-03-24T18:08:08.000Z | tools/mapred/reducer.py | EMinsight/Silo | a1e27d34e8b52196be2de3d4aae2d0cae21b3f36 | [
"Apache-2.0"
] | 4 | 2021-12-28T11:40:36.000Z | 2022-03-30T08:51:51.000Z | #!/usr/bin/env python
from operator import itemgetter
import sys
current_word = None
current_z = None
current_rgb = None
word = None
# input comes from STDIN
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# parse the input we got from mapper.py
word, pixval =... | 24.520833 | 63 | 0.611725 |
883d8e3f3016d724a687503f401ac16704441f8f | 1,128 | py | Python | blogs/pandas-pvtkey/setup.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | 2 | 2022-01-06T11:52:57.000Z | 2022-01-09T01:53:56.000Z | blogs/pandas-pvtkey/setup.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | null | null | null | blogs/pandas-pvtkey/setup.py | Glairly/introduction_to_tensorflow | aa0a44d9c428a6eb86d1f79d73f54c0861b6358d | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 36.387097 | 75 | 0.670213 |
fba807abc069cf0bd4ffca40950d500e380f7322 | 634 | bzl | Python | bazel-rules/gen_test.bzl | felixonmars/tectonic-installer | ef9246a7ed59904224638f28999aac5b88c5b8e4 | [
"Apache-2.0"
] | 2 | 2021-05-07T15:40:00.000Z | 2021-07-15T22:49:55.000Z | bazel-rules/gen_test.bzl | felixonmars/tectonic-installer | ef9246a7ed59904224638f28999aac5b88c5b8e4 | [
"Apache-2.0"
] | 3 | 2017-09-08T18:46:07.000Z | 2017-12-07T15:37:33.000Z | bazel-rules/gen_test.bzl | felixonmars/tectonic-installer | ef9246a7ed59904224638f28999aac5b88c5b8e4 | [
"Apache-2.0"
] | 6 | 2017-06-26T21:22:47.000Z | 2017-12-04T18:44:31.000Z | def generate_script(command):
return """
set -ex
{command}
""".format(command=command)
def _impl(ctx):
script = generate_script(ctx.attr.command)
# Write the file, it is executed by 'bazel test'.
ctx.actions.write(
output=ctx.outputs.executable,
content=script
)
# To ensure the files needed b... | 21.862069 | 74 | 0.675079 |
9e389676140ec1ecfacc180f4ead972f3374dae7 | 678 | py | Python | vault/urls.py | royaleagle-dev/infosafe | fcb00a67d6a8fdd3d2e032b53b56bbcf35d844b6 | [
"Apache-2.0"
] | null | null | null | vault/urls.py | royaleagle-dev/infosafe | fcb00a67d6a8fdd3d2e032b53b56bbcf35d844b6 | [
"Apache-2.0"
] | null | null | null | vault/urls.py | royaleagle-dev/infosafe | fcb00a67d6a8fdd3d2e032b53b56bbcf35d844b6 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
#from . models import Vault, Category
from . import views
app_name = 'vault'
urlpatterns = [
path('', views.IndexListView.as_view(), name = 'index'),
path('<int:pk>/', views.VaultDetailView.as_view(), name = 'detail'),
path('unlock/', views.unlock, name = 'unlock'),
path('delete/<int:... | 39.882353 | 69 | 0.682891 |
ea5d0a1a619cf2fa36d22ffec444c804e8fe935a | 4,904 | py | Python | scripts/analysis/profuzzbench_plot.py | cyruscyliu/nyx-net-profuzzbench | 1e93833160e09529245b56237dfe2e855d648059 | [
"Apache-2.0"
] | 4 | 2021-11-15T03:31:59.000Z | 2021-11-15T12:46:40.000Z | scripts/analysis/profuzzbench_plot.py | cyruscyliu/nyx-net-profuzzbench | 1e93833160e09529245b56237dfe2e855d648059 | [
"Apache-2.0"
] | 1 | 2022-03-04T19:38:42.000Z | 2022-03-06T13:23:27.000Z | scripts/analysis/profuzzbench_plot.py | cyruscyliu/nyx-net-profuzzbench | 1e93833160e09529245b56237dfe2e855d648059 | [
"Apache-2.0"
] | 2 | 2021-11-15T00:23:20.000Z | 2022-02-16T18:10:07.000Z | #!/usr/bin/env python3
import argparse
import matplotlib.pyplot as plt
import pandas as pd
import statistics
CUT = True
LOG = False
def main(csv_file, put, runs, cut_off, step, out_file):
#Read the results
df = pd.read_csv(csv_file)
#Calculate the mean of code coverage
#Store in a list first for ef... | 37.151515 | 84 | 0.472064 |
3ba20f7d3d9e0038b41bccafcf9fb6c2f1659842 | 32,805 | py | Python | proteus/SpatialTools.py | yuxianglin/proteus | ac5d5223410b1a1f270615f987e9cf327fb802af | [
"NASA-1.3"
] | null | null | null | proteus/SpatialTools.py | yuxianglin/proteus | ac5d5223410b1a1f270615f987e9cf327fb802af | [
"NASA-1.3"
] | null | null | null | proteus/SpatialTools.py | yuxianglin/proteus | ac5d5223410b1a1f270615f987e9cf327fb802af | [
"NASA-1.3"
] | null | null | null | """Module creating predifined or custom shapes. Each shape needs a
Domain as argument (from proteus.Domain). A Domain can contain any
number of shapes. Boundary conditions objects are automatically
created for each facet (3D) or segment (2D) defining the shape.
Classes:
* Shape: super class, regroups functions com... | 36.049451 | 85 | 0.511965 |
929fa27b77007d45858e8460970f115f9fb2b513 | 1,465 | py | Python | src/datasets/fish_clf.py | AliKhoda/DeepFish | 6769e83ab0b586e49f48e28f70607d33b5c36718 | [
"MIT"
] | 48 | 2020-09-02T00:46:50.000Z | 2022-03-16T14:38:36.000Z | src/datasets/fish_clf.py | DoranLyong/DeepFish | 3ea3e13653f708d4a8dcb54b990dcc2997edf4e9 | [
"MIT"
] | 5 | 2020-11-22T07:33:04.000Z | 2022-03-28T03:27:58.000Z | src/datasets/fish_clf.py | DoranLyong/DeepFish | 3ea3e13653f708d4a8dcb54b990dcc2997edf4e9 | [
"MIT"
] | 14 | 2020-11-21T15:33:31.000Z | 2022-03-16T12:33:23.000Z | import pandas as pd
import numpy as np
from src import datasets
import os
from PIL import Image
from torchvision import transforms
class FishClf:
def __init__(self, split, transform=None, datadir="",
n_samples=None, habitat=None):
self.split = split
self.n_classes = 2
sel... | 28.173077 | 88 | 0.591126 |
710acb5dd423add1055da5b37736a610db735fd0 | 8,183 | py | Python | src/GUI/GUIPlot.py | AndreaG93/CPS-Project | e4821aace39b04f8504f3f878fa605d99aaacc8e | [
"MIT"
] | null | null | null | src/GUI/GUIPlot.py | AndreaG93/CPS-Project | e4821aace39b04f8504f3f878fa605d99aaacc8e | [
"MIT"
] | null | null | null | src/GUI/GUIPlot.py | AndreaG93/CPS-Project | e4821aace39b04f8504f3f878fa605d99aaacc8e | [
"MIT"
] | null | null | null | import calendar
import ipywidgets
from IPython.core.display import clear_output, display
class GUIPlot(object):
"""
This class is used to build and manage a very simple user interface using some interactive HTML widgets
provided by 'ipywidgets' package.
For reference please see: https://ipywidgets.re... | 43.526596 | 120 | 0.564096 |
f75b01cc9f9b04f800eff05a55cbfb0fe7f0fa5a | 5,854 | py | Python | netbox/extras/querysets.py | fireman0865/allbox | 31ffb39f2f4f089053b77d1fb4e13cc61239a4c4 | [
"Apache-2.0"
] | null | null | null | netbox/extras/querysets.py | fireman0865/allbox | 31ffb39f2f4f089053b77d1fb4e13cc61239a4c4 | [
"Apache-2.0"
] | null | null | null | netbox/extras/querysets.py | fireman0865/allbox | 31ffb39f2f4f089053b77d1fb4e13cc61239a4c4 | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from django.db.models import OuterRef, Subquery, Q
from extras.models.tags import TaggedItem
from utilities.query_functions import EmptyGroupByJSONBAgg, OrderableJSONBAgg
from utilities.querysets import RestrictedQuerySet
class CustomFieldQueryset:
"""
Annotate custom fie... | 39.554054 | 115 | 0.619918 |
722a45740b5d7b00a73cd80dcc909823152545ce | 11,173 | py | Python | venv/lib/python2.7/site-packages/ansible/modules/network/aci/aci_domain_to_encap_pool.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 37 | 2017-08-15T15:02:43.000Z | 2021-07-23T03:44:31.000Z | venv/lib/python2.7/site-packages/ansible/modules/network/aci/aci_domain_to_encap_pool.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 12 | 2018-01-10T05:25:25.000Z | 2021-11-28T06:55:48.000Z | venv/lib/python2.7/site-packages/ansible/modules/network/aci/aci_domain_to_encap_pool.py | haind27/test01 | 7f86c0a33eb0874a6c3f5ff9a923fd0cfc8ef852 | [
"MIT"
] | 49 | 2017-08-15T09:52:13.000Z | 2022-03-21T17:11:54.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1'... | 31.036111 | 141 | 0.634118 |
544bd4f8e001e1d9a84360d570f3f20287e8ace0 | 3,204 | py | Python | .leetcode/113.path-sum-ii.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/113.path-sum-ii.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/113.path-sum-ii.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=113 lang=python3
#
# [113] Path Sum II
#
# https://leetcode.com/problems/path-sum-ii/description/
#
# algorithms
# Medium (49.67%)
# Likes: 2799
# Dislikes: 85
# Total Accepted: 416.5K
# Total Submissions: 834.9K
# Testcase Example: '[5,4,8,11,null,13,4,7,2,null,null,5,1]\n22'
#
# Given the... | 21.218543 | 79 | 0.51623 |
c6b48bf76b3b3fe9a278f1e17d4a1a1f5eabe905 | 11,547 | py | Python | src/spaceone/monitoring/connector/cloudtrail_connector.py | xellos00/plugin-aws-cloudtrail | 2ac4ab4a3c013fad489f1f8a21c5e08662a4cb20 | [
"Apache-2.0"
] | 2 | 2020-06-22T01:48:21.000Z | 2020-08-07T05:22:55.000Z | src/spaceone/monitoring/connector/cloudtrail_connector.py | xellos00/plugin-aws-cloudtrail | 2ac4ab4a3c013fad489f1f8a21c5e08662a4cb20 | [
"Apache-2.0"
] | null | null | null | src/spaceone/monitoring/connector/cloudtrail_connector.py | xellos00/plugin-aws-cloudtrail | 2ac4ab4a3c013fad489f1f8a21c5e08662a4cb20 | [
"Apache-2.0"
] | 3 | 2020-09-09T03:34:25.000Z | 2021-03-25T05:19:40.000Z | # -*- coding: utf-8 -*-
import os
import os.path
# AWS SDK for Python
import boto3
import json
import re
import logging
import pprint
import time
from multiprocessing import Pool
from datetime import datetime
from spaceone.core.transaction import Transaction
from spaceone.core.error import *
from spaceone.core.conne... | 32.991429 | 114 | 0.599376 |
a838e0cb64c4438f94af18780188138890ca04ab | 469 | py | Python | api/Reset.py | Purdue-ECE-461/project-2-3 | 77a12793b8e799982efa0508c8600ae81dc1fc07 | [
"Apache-2.0"
] | 1 | 2022-01-25T18:11:32.000Z | 2022-01-25T18:11:32.000Z | api/Reset.py | Purdue-ECE-461/project-2-3 | 77a12793b8e799982efa0508c8600ae81dc1fc07 | [
"Apache-2.0"
] | null | null | null | api/Reset.py | Purdue-ECE-461/project-2-3 | 77a12793b8e799982efa0508c8600ae81dc1fc07 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
import responses
import requests
import main
app = Flask(__name__)
if __name__ == "__main__" :
request = requests.Request("/reset/",
headers={"X-Authorization": "bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE... | 39.083333 | 217 | 0.748401 |
92fb7a3e84bb688c0c749a77915611b82c004d0c | 2,235 | py | Python | pyembroidery/ReadHelper.py | shnwnd/pyembroidery | 0540db636c07526caec4e31eb905dda4ae51c0cb | [
"MIT"
] | null | null | null | pyembroidery/ReadHelper.py | shnwnd/pyembroidery | 0540db636c07526caec4e31eb905dda4ae51c0cb | [
"MIT"
] | null | null | null | pyembroidery/ReadHelper.py | shnwnd/pyembroidery | 0540db636c07526caec4e31eb905dda4ae51c0cb | [
"MIT"
] | null | null | null | def signed8(b):
if b > 127:
return -256 + b
else:
return b
def signed16(v):
v &= 0xFFFF
if v > 0x7FFF:
return - 0x10000 + v
else:
return v
def signed24(v):
v &= 0xFFFFFF
if v > 0x7FFFFF:
return - 0x1000000 + v
else:
return v
def read_... | 21.084906 | 60 | 0.53915 |
0ac762b57f2a0b6ea4ff60c989214694f75626d0 | 656 | py | Python | code/DeepCTR/deepctr/models/__init__.py | Puzz1eX/HFCN | 81880cb8d4ccb1969a8df7b6dedbec05a5c18590 | [
"MIT"
] | null | null | null | code/DeepCTR/deepctr/models/__init__.py | Puzz1eX/HFCN | 81880cb8d4ccb1969a8df7b6dedbec05a5c18590 | [
"MIT"
] | null | null | null | code/DeepCTR/deepctr/models/__init__.py | Puzz1eX/HFCN | 81880cb8d4ccb1969a8df7b6dedbec05a5c18590 | [
"MIT"
] | null | null | null | from .afm import AFM
from .autoint import AutoInt
from .ccpm import CCPM
from .dcn import DCN
from .deepfm import DeepFM
from .dien import DIEN
from .din import DIN
from .fnn import FNN
from .mlr import MLR
from .onn import ONN
from .onn import ONN as NFFM
from .nfm import NFM
from .pnn import PNN
from .wdl import WDL
... | 27.333333 | 132 | 0.699695 |
f061ddce867e2f6a535f872236f96150b628eeec | 919 | py | Python | Yquote.py | Anupam-dagar/Quote-from-Yourquote.in | 93026ca86a2956858df74e3097a498e751f597aa | [
"MIT"
] | 2 | 2018-12-18T20:45:08.000Z | 2018-12-21T17:02:07.000Z | Yquote.py | Anupam-dagar/Quote-from-Yourquote.in | 93026ca86a2956858df74e3097a498e751f597aa | [
"MIT"
] | null | null | null | Yquote.py | Anupam-dagar/Quote-from-Yourquote.in | 93026ca86a2956858df74e3097a498e751f597aa | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import requests
import random
class Yquote():
def __init__(self):
self.response = ""
self.tag = ""
self.website_url = ""
def generate_url(self, tag):
self.tag = tag
self.website_url = 'https://www.yourquote.in/tags/' + self.tag + '/quotes'
... | 26.257143 | 82 | 0.622416 |
5951f11ecb933db90ab5f683e27d9b242943fe4c | 5,486 | py | Python | validate.py | UAlbanyArchives/asInventory | 26840949821cac6235675bb414d50b3ece3cada9 | [
"Unlicense"
] | 6 | 2017-08-18T18:55:43.000Z | 2018-05-04T23:03:04.000Z | validate.py | UAlbanyArchives/asInventory | 26840949821cac6235675bb414d50b3ece3cada9 | [
"Unlicense"
] | null | null | null | validate.py | UAlbanyArchives/asInventory | 26840949821cac6235675bb414d50b3ece3cada9 | [
"Unlicense"
] | 1 | 2017-06-02T20:38:43.000Z | 2017-06-02T20:38:43.000Z | import os
from archives_tools import dacs
import openpyxl
import sys
import string
__location__ = (os.path.dirname(os.path.realpath(__file__)))
inputPath = os.path.join(__location__, "input")
daoFileList = []
def dateCheck(date, errorCount, lineCount, title):
if " " in date.strip():
try:
print ("Line " + str(... | 36.573333 | 116 | 0.562158 |
008eda47e815c151796df5403ed337fdbeaa94ba | 3,831 | py | Python | utils/save_traj.py | paperanonymous945/MapRec | 5be48b02db855ce648d2674923a15c65afa90146 | [
"MIT"
] | 21 | 2021-06-11T04:32:25.000Z | 2022-03-27T06:04:20.000Z | utils/save_traj.py | paperanonymous945/MapRec | 5be48b02db855ce648d2674923a15c65afa90146 | [
"MIT"
] | 1 | 2021-06-17T02:22:10.000Z | 2021-06-21T12:53:07.000Z | utils/save_traj.py | paperanonymous945/MapRec | 5be48b02db855ce648d2674923a15c65afa90146 | [
"MIT"
] | 12 | 2021-05-26T02:57:43.000Z | 2022-03-29T01:21:00.000Z | #!/usr/bin/python3
# coding: utf-8
# @Time : 2020/9/23 15:40
# Reference: https://github.com/huiminren/tptk/blob/master/common/trajectory.py
from common.trajectory import get_tid
from utils.coord_transform import GCJ02ToWGS84, WGS84ToGCJ02, Convert
class SaveTraj:
"""
SaveTraj is an abstract class for stor... | 39.091837 | 116 | 0.51005 |
e02a7ecd0788139d54f8090fa75aa2e28c72260f | 1,046 | py | Python | tests/generate_input.py | CrueLu/baowow | af38412ed04293aaf604eb34e35776096f9f00e8 | [
"Apache-2.0"
] | 322 | 2017-10-18T09:15:50.000Z | 2022-03-31T22:46:06.000Z | tests/generate_input.py | CrueLu/baowow | af38412ed04293aaf604eb34e35776096f9f00e8 | [
"Apache-2.0"
] | 36 | 2017-10-21T16:51:29.000Z | 2021-12-10T11:07:10.000Z | tests/generate_input.py | CrueLu/baowow | af38412ed04293aaf604eb34e35776096f9f00e8 | [
"Apache-2.0"
] | 17 | 2018-11-01T19:51:32.000Z | 2022-03-01T14:43:10.000Z | #! /usr/bin/env python3
# Usage: ./test.py <count>
#
# Input bytes are generated by incrementing a 4-byte little-endian integer,
# starting with 1. For example, an input of length 10 would be the bytes
# [1, 0, 0, 0, 2, 0, 0, 0, 3, 0]. The goal is to make is unlikely that a bug
# like swapping or duplicating a chunk c... | 24.325581 | 76 | 0.652964 |
e3fac4605f28808b4071e1bddac03ecfc6e65588 | 125 | py | Python | 2.py | AJ-54/Intro-to-Webd | 4d68784cea8a5f26f3f55a4d736d5fa08c6f37bb | [
"MIT"
] | 1 | 2019-01-15T09:02:31.000Z | 2019-01-15T09:02:31.000Z | 2.py | AJ-54/Intro-to-Webd | 4d68784cea8a5f26f3f55a4d736d5fa08c6f37bb | [
"MIT"
] | null | null | null | 2.py | AJ-54/Intro-to-Webd | 4d68784cea8a5f26f3f55a4d736d5fa08c6f37bb | [
"MIT"
] | null | null | null | s=list(input("Enter the names with commas:").split(","))
for i in s:
f=" "
a=i.split(" ")
for j in a:
f+=j[0]
print(f)
| 15.625 | 56 | 0.552 |
603155ce4e99284243eba94bea9f0772546a3d7b | 11,524 | py | Python | modules/text/sentiment_analysis/senta_gru/module.py | cjt222/HubModule | a741ad35db53b1e6eeaeecc5f246db1ea2386519 | [
"Apache-2.0"
] | null | null | null | modules/text/sentiment_analysis/senta_gru/module.py | cjt222/HubModule | a741ad35db53b1e6eeaeecc5f246db1ea2386519 | [
"Apache-2.0"
] | null | null | null | modules/text/sentiment_analysis/senta_gru/module.py | cjt222/HubModule | a741ad35db53b1e6eeaeecc5f246db1ea2386519 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import ast
import json
import math
import numpy as np
import os
import six
import paddle.fluid as fluid
from paddle.fluid.core import PaddleTensor, AnalysisConfig, create... | 33.402899 | 98 | 0.584346 |
0e4a175a56f27e7400eff03a87934f564fa5ebc7 | 1,438 | py | Python | ob_pipelines/tasks/merge_ercc.py | outlierbio/ob-pipelines | c49c735d37f4eaa7e804df502a761580f7ce9e32 | [
"Apache-2.0"
] | 11 | 2017-01-22T22:08:45.000Z | 2020-03-10T20:17:14.000Z | ob_pipelines/tasks/merge_ercc.py | outlierbio/ob-pipelines | c49c735d37f4eaa7e804df502a761580f7ce9e32 | [
"Apache-2.0"
] | null | null | null | ob_pipelines/tasks/merge_ercc.py | outlierbio/ob-pipelines | c49c735d37f4eaa7e804df502a761580f7ce9e32 | [
"Apache-2.0"
] | 6 | 2017-01-23T01:24:33.000Z | 2018-07-18T13:30:06.000Z | from luigi import Parameter
from luigi.contrib.s3 import S3Target
from ob_pipelines import LoggingTaskWrapper
from ob_pipelines.apps.kallisto import merge_column
from ob_pipelines.config import settings
from ob_pipelines.entities.persistence import get_samples_by_experiment_id
from ob_pipelines.s3 import csv_to_s3
fro... | 35.95 | 102 | 0.698887 |
304d8ebb0ce7c017a49e8f9e4ce9a7d6bb630a5b | 7,471 | py | Python | aries_cloudagent/protocols/discovery/v1_0/manager.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 4 | 2019-07-01T13:12:50.000Z | 2019-07-02T20:01:37.000Z | aries_cloudagent/protocols/discovery/v1_0/manager.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 51 | 2021-01-12T05:50:50.000Z | 2022-03-25T06:03:13.000Z | aries_cloudagent/protocols/discovery/v1_0/manager.py | kuraakhilesh8230/aries-cloudagent-python | ee384d1330f6a50ff45a507392ce54f92900f23a | [
"Apache-2.0"
] | 12 | 2019-06-24T22:17:44.000Z | 2019-07-02T19:49:31.000Z | """Classes to manage discover features."""
import asyncio
import logging
from typing import Optional
from ....core.error import BaseError
from ....core.profile import Profile
from ....core.protocol_registry import ProtocolRegistry
from ....storage.error import StorageNotFoundError
from ....messaging.responder import... | 40.166667 | 88 | 0.60514 |
d7b4772ef2055f664516f36d103e50d1900d2192 | 3,534 | py | Python | bindings/python/ensmallen/datasets/string/lactobacillussakei.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/lactobacillussakei.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/lactobacillussakei.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Lactobacillus sakei.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein as... | 32.722222 | 223 | 0.676287 |
9e40b740c64092dec238e1e6ad24a9066ea6452d | 6,478 | py | Python | python/ray/tests/test_multi_node_2.py | LucaCappelletti94/ray | a3433ba51fbafae187fdc200617f75f96eb6779f | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_multi_node_2.py | LucaCappelletti94/ray | a3433ba51fbafae187fdc200617f75f96eb6779f | [
"Apache-2.0"
] | 5 | 2021-08-25T16:17:15.000Z | 2022-03-12T01:00:29.000Z | python/ray/tests/test_multi_node_2.py | yurirocha15/ray | f6d9996874c7e5e90380c968c6f570084a940ef3 | [
"Apache-2.0"
] | 2 | 2020-05-22T15:36:27.000Z | 2020-05-22T15:52:03.000Z | import logging
import pytest
import time
import ray
import ray.ray_constants as ray_constants
from ray.autoscaler.sdk import request_resources
from ray.monitor import Monitor
from ray.cluster_utils import Cluster
from ray.test_utils import generate_system_config_map, SignalActor
logger = logging.getLogger(__name__)
... | 29.990741 | 77 | 0.650818 |
cb2b5e43b3284095d7b2dfc29086a567d34552c3 | 581 | py | Python | gitman/__main__.py | petergmorgan/gitman | 6960d04956bbcc2c1512fcaed7e5d7c34f5999ba | [
"MIT"
] | null | null | null | gitman/__main__.py | petergmorgan/gitman | 6960d04956bbcc2c1512fcaed7e5d7c34f5999ba | [
"MIT"
] | null | null | null | gitman/__main__.py | petergmorgan/gitman | 6960d04956bbcc2c1512fcaed7e5d7c34f5999ba | [
"MIT"
] | null | null | null | """Package entry point."""
# Declare itself as package if needed for better debugging support
# pylint: disable=multiple-imports,wrong-import-position,redefined-builtin,used-before-assignment
if __name__ == '__main__' and __package__ is None: # pragma: no cover
import os, sys, importlib
parent_dir = os.path.a... | 32.277778 | 97 | 0.743546 |
a47f940bfe5e62ec33565bd6df2c2c83fa05a4b7 | 20,454 | py | Python | torch/_tensor_str.py | mcx/pytorch | b02b3f25dbffeead4f06d32e75dd4a282e8b0b5f | [
"Intel"
] | null | null | null | torch/_tensor_str.py | mcx/pytorch | b02b3f25dbffeead4f06d32e75dd4a282e8b0b5f | [
"Intel"
] | null | null | null | torch/_tensor_str.py | mcx/pytorch | b02b3f25dbffeead4f06d32e75dd4a282e8b0b5f | [
"Intel"
] | null | null | null | import math
import torch
from torch._six import inf
from typing import Optional
class __PrinterOptions(object):
precision: int = 4
threshold: float = 1000
edgeitems: int = 3
linewidth: int = 80
sci_mode: Optional[bool] = None
PRINT_OPTS = __PrinterOptions()
# We could use **kwargs, but this wi... | 43.705128 | 115 | 0.609465 |
eefc5464fbb9ab9b28869f719742ae62d4e727c7 | 12,301 | py | Python | mc/debug.py | arup-group/mc | 50b8faa8b9d40dece88e0a27f911edd427ebc064 | [
"MIT"
] | null | null | null | mc/debug.py | arup-group/mc | 50b8faa8b9d40dece88e0a27f911edd427ebc064 | [
"MIT"
] | 12 | 2021-12-14T15:10:43.000Z | 2022-03-31T13:39:25.000Z | mc/debug.py | arup-group/mc | 50b8faa8b9d40dece88e0a27f911edd427ebc064 | [
"MIT"
] | null | null | null | """
Class inherited by BaseConfig for carrying out debugging.
"""
from typing import Tuple
class BaseDebug:
"""
Debugging Base class.
"""
def get(self, key, default):
raise NotImplementedError
def debug(self, verbose=True) -> Tuple[bool, list]:
"""
Build a list of debug m... | 36.610119 | 117 | 0.580359 |
06b5b36b9c4c4ad55ad1f5b8c058e67a7a75989a | 765 | py | Python | tests/test_support.py | rageyboiii/test-boy | 089309d279fc21aca28b8a68725a52f1170edd29 | [
"CC0-1.0"
] | 5 | 2021-09-04T09:08:55.000Z | 2022-02-08T00:28:08.000Z | tests/test_support.py | rageyboiii/test-boy | 089309d279fc21aca28b8a68725a52f1170edd29 | [
"CC0-1.0"
] | 2 | 2021-10-11T21:44:08.000Z | 2021-11-05T07:41:23.000Z | tests/test_support.py | rageyboiii/test-boy | 089309d279fc21aca28b8a68725a52f1170edd29 | [
"CC0-1.0"
] | 3 | 2021-09-04T09:12:34.000Z | 2021-12-16T20:02:03.000Z | import pytest
from typing_extensions import TYPE_CHECKING
if TYPE_CHECKING:
from .conftest import bot, channel
@pytest.mark.asyncio
async def test_support(bot: "bot", channel: "channel"):
content = "!support"
await channel.send(content)
msg = await bot.wait_for("message", check=lambda message: pytest.msg_ch... | 31.875 | 131 | 0.746405 |
535eada3721ea18d34bdddd276d925f377d2f1fd | 4,869 | py | Python | CIM100/IEC61970/Base/Meas/ValueAliasSet.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM100/IEC61970/Base/Meas/ValueAliasSet.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM100/IEC61970/Base/Meas/ValueAliasSet.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | 41.262712 | 989 | 0.687616 |
400ab6130eeaba41bf2f08e12156288e081d4bfd | 5,113 | py | Python | mix_assembler.py | crashfrog/Dispatch | 4247cacaefcf33644c7d1f18a0553962441b2941 | [
"Unlicense"
] | 1 | 2017-09-13T03:01:41.000Z | 2017-09-13T03:01:41.000Z | mix_assembler.py | crashfrog/Dispatch | 4247cacaefcf33644c7d1f18a0553962441b2941 | [
"Unlicense"
] | null | null | null | mix_assembler.py | crashfrog/Dispatch | 4247cacaefcf33644c7d1f18a0553962441b2941 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import subprocess
import tempfile
import shutil
import os
import re
import fasta_statter
"""
Mix, the assembly-aggregating microbial genome finishing tool.
See: "Finishing bacterial genome assemblies with Mix"
Soueidan et al. BMC Bioinformatics 2013, 14(Suppl 15):S16
http://www.biomedc... | 36.007042 | 217 | 0.691766 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.