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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c28884618590ab07181ba314399eee06f9e0c118 | 3,164 | py | Python | twitter/monitor.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | twitter/monitor.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | twitter/monitor.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | from Database import Database_connection as db
database = db()
qy = """
INSERT INTO `berita_detail` (`judul`, `waktu`, `tag`, `isi`, `sumber`) VALUES
('Mentan harap tatanan normal baru pulihkan permintaan produk pertanian', '2020-06-07', '[normal baru,new normal,petani]', ' Dengan kebijakan normal baru utamanya di sekt... | 186.117647 | 2,813 | 0.825221 | from Database import Database_connection as db
database = db()
qy = """
INSERT INTO `berita_detail` (`judul`, `waktu`, `tag`, `isi`, `sumber`) VALUES
('Mentan harap tatanan normal baru pulihkan permintaan produk pertanian', '2020-06-07', '[normal baru,new normal,petani]', ' Dengan kebijakan normal baru utamanya di sekt... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7eea654809c7f7d973ae8eefe76d18979ef844b1 | 1,869 | py | Python | custombot/utils/loader.py | other-z/custombot | 4e53f096491ce5b388f92bbdb2e58f6ecc5dcee6 | [
"MIT"
] | 1 | 2021-02-20T07:27:33.000Z | 2021-02-20T07:27:33.000Z | custombot/utils/loader.py | other-z/custombot | 4e53f096491ce5b388f92bbdb2e58f6ecc5dcee6 | [
"MIT"
] | null | null | null | custombot/utils/loader.py | other-z/custombot | 4e53f096491ce5b388f92bbdb2e58f6ecc5dcee6 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
@Topic:
@Date: 2020/12/8
@Author: other.z
@CopyrightC: 2020-2023 other.z Inc. All rights reserved.
"""
| 20.538462 | 90 | 0.5939 | # coding: utf-8
"""
@Topic:
@Date: 2020/12/8
@Author: other.z
@Copyright(C): 2020-2023 other.z Inc. All rights reserved.
"""
import py
import os
import json
import yaml
import warnings
from dotenv import dotenv_values, find_dotenv
class _LoaderBase:
suffixs = []
def __init__(self, filepath):
... | 6 | 695 | 0 | 761 | 0 | 0 | 0 | -26 | 298 |
3fa4b4fa52abc9f245081402e6639fe81ea003c4 | 6,752 | py | Python | mosviz/controls/tests/test_slit_controller.py | rosteen/mosviz | 90f8ac095b3b41117917878be51b9a6d6afa9595 | [
"BSD-3-Clause"
] | null | null | null | mosviz/controls/tests/test_slit_controller.py | rosteen/mosviz | 90f8ac095b3b41117917878be51b9a6d6afa9595 | [
"BSD-3-Clause"
] | null | null | null | mosviz/controls/tests/test_slit_controller.py | rosteen/mosviz | 90f8ac095b3b41117917878be51b9a6d6afa9595 | [
"BSD-3-Clause"
] | null | null | null |
import numpy as np
from astropy.wcs import WCS
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.wcs.utils import proj_plane_pixel_area
from mosviz.viewers.mos_viewer import MOSVizViewer
def construct_test_wcs(ra=0., dec=0., x=0., y=0., area=1.0):
"""
Constructs an `~astropy.w... | 30.278027 | 83 | 0.647068 | import pytest
import numpy as np
from astropy.wcs import WCS
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.wcs.utils import proj_plane_pixel_area
from mosviz.viewers.mos_viewer import MOSVizViewer
def construct_test_wcs(ra=0., dec=0., x=0., y=0., area=1.0):
"""
Constructs ... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
718b5bef13c6446057058242ee77fdd12823e77a | 4,020 | py | Python | examples/lime_MMBT_example.py | junqi-jiang/mmxai | 08ae70a6d443fbdfa92dba6cd285429e85ac851f | [
"MIT"
] | 6 | 2021-05-19T16:44:46.000Z | 2021-05-19T16:46:43.000Z | examples/lime_MMBT_example.py | junqi-jiang/mmxai | 08ae70a6d443fbdfa92dba6cd285429e85ac851f | [
"MIT"
] | 8 | 2021-05-19T17:23:29.000Z | 2021-06-09T09:58:02.000Z | examples/lime_MMBT_example.py | junqi-jiang/mmxai | 08ae70a6d443fbdfa92dba6cd285429e85ac851f | [
"MIT"
] | null | null | null | from mmf.models.mmbt import MMBT
from PIL import Image
import matplotlib.pyplot as plt
model = MMBT.from_pretrained("mmbt.hateful_memes.images")
img_name = "" # replace this with image path
img_text = "" # replace this with memes text
img_try = Image.open(img_name)
# predict
output = model.classify(img_try, img... | 29.777778 | 94 | 0.648259 | from mmf.models.mmbt import MMBT
from mmxai.interpretability.classification.lime.lime_multimodal import LimeMultimodalExplainer
import numpy as np
from PIL import Image
from skimage.segmentation import mark_boundaries
from skimage import img_as_ubyte
import matplotlib.pyplot as plt
import torch
import json
import re
... | 0 | 0 | 0 | 0 | 0 | 2,901 | 0 | 77 | 200 |
9c451013147b6dc471fab46150af3490ce0bf58a | 5,247 | py | Python | Python/_10_02/Dog/stdarray.py | MBkkt/Homework | db92bdb9262f1737d637f01d5cf2d3680e379a7b | [
"MIT"
] | 1 | 2019-04-07T18:27:29.000Z | 2019-04-07T18:27:29.000Z | Python/_10_02/Dog/stdarray.py | MBkkt/Homework | db92bdb9262f1737d637f01d5cf2d3680e379a7b | [
"MIT"
] | 1 | 2019-10-02T23:01:01.000Z | 2019-10-02T23:01:01.000Z | Python/_10_02/Dog/stdarray.py | MBkkt/Homework | db92bdb9262f1737d637f01d5cf2d3680e379a7b | [
"MIT"
] | 2 | 2018-10-19T22:42:54.000Z | 2019-03-10T14:57:59.000Z | """
stdarray.py
The stdarray module defines functions related to creating, reading,
and writing one- and two-dimensional arrays.
"""
import _10_02.Dog.stdio as stdio
#=======================================================================
# Array creation functions
#==================================================... | 28.98895 | 72 | 0.482371 | """
stdarray.py
The stdarray module defines functions related to creating, reading,
and writing one- and two-dimensional arrays.
"""
import _10_02.Dog.stdio as stdio
#=======================================================================
# Array creation functions
#==================================================... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fdd0c94f13eaf25e938ee66fe93dd266a06f71da | 256 | py | Python | gork/utils.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | 2 | 2019-11-24T14:34:29.000Z | 2020-11-05T19:56:50.000Z | gork/utils.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | null | null | null | gork/utils.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | 1 | 2021-04-01T12:41:27.000Z | 2021-04-01T12:41:27.000Z |
DEFAULT_PIXEL_SIZE = 10
DEFAULT_N_CLUSTERS = 256
| 23.272727 | 53 | 0.773438 | from gork.palette import COLOR_TREE, PALETTE
from gork.structs import RGB, Color
DEFAULT_PIXEL_SIZE = 10
DEFAULT_N_CLUSTERS = 256
def get_nearest_color(rgb: RGB) -> Color:
distance, result = COLOR_TREE.query(rgb.as_tuple)
return PALETTE[result]
| 0 | 0 | 0 | 0 | 0 | 101 | 0 | 37 | 67 |
67d91682b7361980dedb029fa4ec3aa3743a4f6d | 3,910 | py | Python | implementations/rest/bin/authhandlers.py | djsincla/SplunkModularInputsPythonFramework | 1dd215214f3d2644cb358e41f4105fe40cff5393 | [
"Apache-2.0"
] | 3 | 2020-08-31T00:59:26.000Z | 2021-10-19T22:01:00.000Z | implementations/rest/bin/authhandlers.py | djsincla/SplunkModularInputsPythonFramework | 1dd215214f3d2644cb358e41f4105fe40cff5393 | [
"Apache-2.0"
] | null | null | null | implementations/rest/bin/authhandlers.py | djsincla/SplunkModularInputsPythonFramework | 1dd215214f3d2644cb358e41f4105fe40cff5393 | [
"Apache-2.0"
] | null | null | null |
#add your custom auth handler class to this module
#template
#example of adding a client certificate
#example of adding a client certificate
#cloudstack auth example | 29.179104 | 100 | 0.586701 | from requests.auth import AuthBase
import hmac
import base64
import hashlib
import urlparse
import urllib
#add your custom auth handler class to this module
class MyEncryptedCredentialsAuthHAndler(AuthBase):
def __init__(self,**args):
# setup any auth-related data here
#self.username = args['usern... | 0 | 0 | 0 | 3,437 | 0 | 0 | 0 | -26 | 291 |
4a96a26f90fa620c4f0488eeb021bdcb55be8d20 | 4,399 | py | Python | gltrader/ui/notifications/notification_row.py | davidmnoll/gltrader | 599f07f68e4146f1774d00e9b10ba8330247e11e | [
"MIT"
] | 4 | 2020-02-26T14:21:27.000Z | 2021-11-15T07:32:34.000Z | gltrader/ui/notifications/notification_row.py | davidmnoll/gltrader | 599f07f68e4146f1774d00e9b10ba8330247e11e | [
"MIT"
] | null | null | null | gltrader/ui/notifications/notification_row.py | davidmnoll/gltrader | 599f07f68e4146f1774d00e9b10ba8330247e11e | [
"MIT"
] | null | null | null | """
This lists a raw balances response from the API
"""
| 43.127451 | 150 | 0.586724 | """
This lists a raw balances response from the API
"""
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.properties import NumericProperty
from kivy.graphics import Color, Rectangle
from ..buttons import SingleMarketButton, RemoveNotificationButton, ActionDoButton
from ...notifi... | 0 | 0 | 0 | 3,991 | 0 | 0 | 0 | 151 | 201 |
90c09b0d490998ee977bd6c9fbfae3cb214a287a | 1,650 | py | Python | scripts/tools.py | Alex-bzh/syllabricks | 7763da169f5fc42e7c3e75b02e42116de0d609ad | [
"MIT"
] | null | null | null | scripts/tools.py | Alex-bzh/syllabricks | 7763da169f5fc42e7c3e75b02e42116de0d609ad | [
"MIT"
] | null | null | null | scripts/tools.py | Alex-bzh/syllabricks | 7763da169f5fc42e7c3e75b02e42116de0d609ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Modules to import
#
#
# Custom functions
#
def nbSyllables(word, sep):
"""
Counts the number of syllables in a word
@param String word: the word
@param String sep: the separator to use
"""
return len(word.split(sep))
#
# Main
... | 25 | 65 | 0.572727 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Modules to import
#
import csv, json
#
# Custom functions
#
def nbSyllables(word, sep):
"""
Counts the number of syllables in a word
@param String word: the word
@param String sep: the separator to use
"""
return len(word.split(s... | 15 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 22 |
f90f399dbc7099b3e6721b1ffbe4b8e263c3e18d | 1,705 | py | Python | data_processor/previous/temp.py | lhq1/legal-predicetion | 0919732d9aecba17630a3dcaedd3611ca990010c | [
"MIT"
] | 87 | 2018-08-27T14:59:11.000Z | 2022-03-01T07:29:27.000Z | data_processor/previous/temp.py | lllybi/TopJudge | c9186b132e79830fd4e855777b06a601d76bf0a2 | [
"MIT"
] | 6 | 2018-10-11T09:29:05.000Z | 2020-12-14T02:29:28.000Z | data_processor/previous/temp.py | lllybi/TopJudge | c9186b132e79830fd4e855777b06a601d76bf0a2 | [
"MIT"
] | 31 | 2018-08-28T00:44:59.000Z | 2022-02-18T18:17:01.000Z | # coding: UTF-8
import json
in_path = "/disk/mysql/law_data/final_data/"
out_path = "/disk/mysql/law_data/temp_data/"
mid_text = u"\t"
num_process = 4
num_file = 20
accusation_file = "/home/zhx/law_pre/data_processor/accusation_list2.txt"
f = open(accusation_file, "r")
accusation_list = json.loads(f.readline())
for ... | 24.014085 | 118 | 0.577126 | # coding: UTF-8
import os
import json
import re
in_path = "/disk/mysql/law_data/final_data/"
out_path = "/disk/mysql/law_data/temp_data/"
mid_text = u"\t"
num_process = 4
num_file = 20
accusation_file = "/home/zhx/law_pre/data_processor/accusation_list2.txt"
f = open(accusation_file, "r")
accusation_list = json.loa... | 0 | 0 | 0 | 0 | 0 | 809 | 0 | -24 | 91 |
609377c98a5d2c961225e96546221a60ab3bcec8 | 13,373 | py | Python | stevedore/datasets_hist.py | SirYetz/Containerized-Forecasting-Workflow | 4a0e9b64f31448bd84d98d72394417f5154e43ef | [
"MIT"
] | 6 | 2018-10-02T10:48:11.000Z | 2020-03-30T23:01:25.000Z | stevedore/datasets_hist.py | SirYetz/Containerized-Forecasting-Workflow | 4a0e9b64f31448bd84d98d72394417f5154e43ef | [
"MIT"
] | null | null | null | stevedore/datasets_hist.py | SirYetz/Containerized-Forecasting-Workflow | 4a0e9b64f31448bd84d98d72394417f5154e43ef | [
"MIT"
] | 3 | 2019-02-11T02:50:21.000Z | 2021-03-05T02:42:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
IBM Containerized Forecasting Workflow
DESCRIPTION
This file contains the class representing the different sources of input data sets.
AUTHOR
Timothy Lynar <timlynar@au1.ibm.com>, IBM Research, Melbourne, Australia
Frank Suits <frankst@au1.ibm.com>, IBM ... | 39.800595 | 100 | 0.631197 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
IBM Containerized Forecasting Workflow
DESCRIPTION
This file contains the class representing the different sources of input data sets.
AUTHOR
Timothy Lynar <timlynar@au1.ibm.com>, IBM Research, Melbourne, Australia
Frank Suits <frankst@au1.ibm.com>, IBM ... | 3 | 0 | 0 | 11,497 | 0 | 0 | 0 | -13 | 405 |
13d5546d1473c01447ce107a1e761d1cf39df8b8 | 2,083 | py | Python | src/trackers/chexx.py | hmgoalie35/chexx | 095ea2adbec6fe04d7c2110cc14e5f42ea765b0f | [
"MIT"
] | null | null | null | src/trackers/chexx.py | hmgoalie35/chexx | 095ea2adbec6fe04d7c2110cc14e5f42ea765b0f | [
"MIT"
] | 1 | 2020-04-12T17:57:39.000Z | 2020-04-12T17:57:39.000Z | src/trackers/chexx.py | hmgoalie35/chexx | 095ea2adbec6fe04d7c2110cc14e5f42ea765b0f | [
"MIT"
] | null | null | null |
GREEN = (0, 255, 0)
BLACK = (0, 0, 0)
| 30.632353 | 96 | 0.540086 | from math import floor
import cv2 as cv
from conf import DATA_MODEL_DIR
from readers.base import BaseReader
GREEN = (0, 255, 0)
BLACK = (0, 0, 0)
class ChexxTracker(BaseReader):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.net = cv.dnn.readNetFromTensorflow(
... | 0 | 0 | 0 | 1,909 | 0 | 0 | 0 | 20 | 113 |
976d9278cf401df8f430afbf2f7b0d0b70fbd717 | 444 | py | Python | 17 Heat capacity.py | L0ganhowlett/Python_workbook-Ben_Stephenson | ab711257bd2da9b34c6001a8e09d20bfc0114a3f | [
"MIT"
] | null | null | null | 17 Heat capacity.py | L0ganhowlett/Python_workbook-Ben_Stephenson | ab711257bd2da9b34c6001a8e09d20bfc0114a3f | [
"MIT"
] | null | null | null | 17 Heat capacity.py | L0ganhowlett/Python_workbook-Ben_Stephenson | ab711257bd2da9b34c6001a8e09d20bfc0114a3f | [
"MIT"
] | null | null | null | #17 Heat Capacity
#Asking for masss of water.
m = float(input("Enter the mass of water in grams = "))
T = float(input("Enter the temperature change in degree celsius = "))
C = 4.186 * (2.7777e-7)
q = m * T * C
print("Total energy required to raise ",m," grams of a material by ",T," degrees Celsius is ",q," kilowa... | 40.363636 | 114 | 0.657658 | #17 Heat Capacity
#Asking for masss of water.
m = float(input("Enter the mass of water in grams = "))
T = float(input("Enter the temperature change in degree celsius = "))
C = 4.186 * (2.7777e-7)
q = m * T * C
print("Total energy required to raise ",m," grams of a material by ",T," degrees Celsius is ",q," kilowa... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1648168d9dc163ada0f7db9901891b4345612cc4 | 3,631 | py | Python | test/unit/ggrc/converters/handlers/test_mapping_column_handler.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-04T10:55:14.000Z | 2019-01-04T10:55:14.000Z | test/unit/ggrc/converters/handlers/test_mapping_column_handler.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/unit/ggrc/converters/handlers/test_mapping_column_handler.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for the MappingColumnHandler class"""
| 37.43299 | 78 | 0.732856 | # -*- coding: utf-8 -*-
# Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for the MappingColumnHandler class"""
import unittest
from mock import MagicMock
from mock import patch
from ggrc.converters.handlers.handlers import MappingColumnHandler
... | 0 | 0 | 0 | 3,239 | 0 | 0 | 0 | 45 | 159 |
d3982f490b09236404bbc09b37f3132f1d76ad93 | 1,058 | py | Python | students/k3342/laboratory_works/Evgenov_Sergei/laboratory_work_1/homework_project_evgenov/homework_app/migrations/0002_auto_20200607_1405.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3342/laboratory_works/Evgenov_Sergei/laboratory_work_1/homework_project_evgenov/homework_app/migrations/0002_auto_20200607_1405.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3342/laboratory_works/Evgenov_Sergei/laboratory_work_1/homework_project_evgenov/homework_app/migrations/0002_auto_20200607_1405.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | # Generated by Django 3.0.5 on 2020-06-07 11:05
| 27.842105 | 121 | 0.599244 | # Generated by Django 3.0.5 on 2020-06-07 11:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('homework_app', '0001_ini... | 0 | 0 | 0 | 878 | 0 | 0 | 0 | 41 | 90 |
95dc51f047e2078a05d5badb90d6fa6e74768be5 | 9,349 | py | Python | tests/test_forcefield.py | gabrielbradford/mdgo | 5e3fcfe735bf32db283136d741f1c7dc2b13d8c4 | [
"MIT"
] | 1 | 2021-12-15T01:18:13.000Z | 2021-12-15T01:18:13.000Z | tests/test_forcefield.py | gabrielbradford/mdgo | 5e3fcfe735bf32db283136d741f1c7dc2b13d8c4 | [
"MIT"
] | 4 | 2021-11-12T20:48:34.000Z | 2021-12-14T23:41:47.000Z | tests/test_forcefield.py | gabrielbradford/mdgo | 5e3fcfe735bf32db283136d741f1c7dc2b13d8c4 | [
"MIT"
] | 4 | 2021-11-12T21:10:53.000Z | 2022-02-07T19:30:57.000Z | import os
import unittest
test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_files")
if __name__ == "__main__":
unittest.main()
| 54.040462 | 114 | 0.63579 | import os
import sys
import tempfile
import unittest
from io import StringIO
import numpy as np
import pytest
from mdgo.forcefield import *
test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_files")
class FFcrawlerTest(unittest.TestCase):
def test_chrome(self) -> None:
with open(... | 0 | 0 | 0 | 9,027 | 0 | 0 | 0 | -18 | 180 |
6f1ce3c1397cc5140b41f86584f1d82192fd2683 | 225 | py | Python | multi_tenant_users/compat.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | 7 | 2018-01-12T04:31:42.000Z | 2021-12-17T15:27:51.000Z | multi_tenant_users/compat.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | null | null | null | multi_tenant_users/compat.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | 1 | 2022-03-18T08:19:10.000Z | 2022-03-18T08:19:10.000Z | """Provides support for django-tenat-schemas and django-tenants."""
try:
from django_tenants.utils import schema_context # NOQA: F401
except ImportError:
| 37.5 | 67 | 0.773333 | """Provides support for django-tenat-schemas and django-tenants."""
try:
from django_tenants.utils import schema_context # NOQA: F401
except ImportError:
from tenant_schemas.utils import schema_context # NOQA: F401
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 40 |
52b4f6eb9858e08ee282051dac34293eb41dbc6f | 1,188 | py | Python | chapter4/solutions/isolve.py | hexu1985/Doing.Math.With.Python | b6a02805cd450325e794a49f55d2d511f9db15a5 | [
"MIT"
] | 109 | 2015-08-28T10:23:24.000Z | 2022-02-15T01:39:51.000Z | chapter4/solutions/isolve.py | hexu1985/Doing.Math.With.Python | b6a02805cd450325e794a49f55d2d511f9db15a5 | [
"MIT"
] | 6 | 2015-12-07T19:35:30.000Z | 2021-05-01T07:25:42.000Z | chapter4/solutions/isolve.py | hexu1985/Doing.Math.With.Python | b6a02805cd450325e794a49f55d2d511f9db15a5 | [
"MIT"
] | 74 | 2015-10-15T18:09:15.000Z | 2022-01-30T05:06:21.000Z | '''
isolve.py
Single variable inequality solver
'''
from sympy import sympify, SympifyError
from sympy.core.relational import Relational, Equality
if __name__ == '__main__':
ineq = input('Enter the inequality to solve: ')
try:
ineq_obj = sympify(ineq)
except SympifyError:
print('Invalid i... | 28.97561 | 83 | 0.670034 | '''
isolve.py
Single variable inequality solver
'''
from sympy import Symbol, sympify, SympifyError
from sympy import solve_poly_inequality, solve_rational_inequalities
from sympy import solve_univariate_inequality, Poly
from sympy.core.relational import Relational, Equality
def isolve(ineq_obj):
x = Symbol('x')... | 0 | 0 | 0 | 0 | 0 | 455 | 0 | 85 | 67 |
91b44e17d70badb72631a661a123680ed9e2daaa | 3,913 | py | Python | Compiler/relu_lib.py | abdelrahamanaly/beyond_rabbit | 932ad4c16c9c9dc37fc6ac9ddef48d21cb58317b | [
"MIT"
] | null | null | null | Compiler/relu_lib.py | abdelrahamanaly/beyond_rabbit | 932ad4c16c9c9dc37fc6ac9ddef48d21cb58317b | [
"MIT"
] | null | null | null | Compiler/relu_lib.py | abdelrahamanaly/beyond_rabbit | 932ad4c16c9c9dc37fc6ac9ddef48d21cb58317b | [
"MIT"
] | null | null | null |
# returns RELUX(x) on sfix as in pytorch
# X is a 3D matrix
# returns RELU(X) as in pytorch
# returns Matrices as it is the requeriment
# X is a 3D matrix
# returns RELU(X) as in pytorch
# returns Matrices as it is the requeriment
| 29.421053 | 106 | 0.594173 | from Compiler.types import sint, sfix
from Compiler.rabbit_lib import rabbit_sint, Mode as rabbit_mode
class Gradient:
OFF, ON = range(2)
class Mode:
SFIX, SINT = range(2)
class relu_response:
def __init__(self, x, c):
self.__x = x
self.__c = c
def get_value(self):
return ... | 0 | 0 | 0 | 715 | 0 | 2,696 | 0 | 59 | 202 |
400e3a228a31547dec6830a90b5a2075dcb2585f | 7,709 | py | Python | torchdynamo/eval_frame.py | jansel/torchdynamo | df478179e881c6fc17e91a4fe075659a29407777 | [
"BSD-3-Clause"
] | 41 | 2021-09-14T14:58:06.000Z | 2022-02-25T12:36:22.000Z | torchdynamo/eval_frame.py | facebookresearch/torchdynamo | eb33efc75e3a76dc5f9c698bb4fd7de3242a2b3c | [
"BSD-3-Clause"
] | 62 | 2022-03-11T00:12:37.000Z | 2022-03-31T20:04:27.000Z | torchdynamo/eval_frame.py | jansel/torchdynamo | df478179e881c6fc17e91a4fe075659a29407777 | [
"BSD-3-Clause"
] | 6 | 2021-11-19T17:50:56.000Z | 2022-02-10T22:31:58.000Z | import contextlib
import logging
import threading
from . import convert_frame
from . import utils
log = logging.getLogger(__name__)
try:
from . import _eval_frame
except (ModuleNotFoundError, ImportError) as e:
raise RuntimeError("run `python setup.py develop` to compile C extensions") from e
set_eval_frame ... | 29.200758 | 88 | 0.661564 | import contextlib
import copy
import functools
import logging
import threading
import torch
from torchdynamo.utils import checkpoint_params
from torchdynamo.utils import clone_inputs
from . import config
from . import convert_frame
from . import skipfiles
from . import utils
from .mutation_guard import install_gener... | 0 | 1,136 | 0 | 2,914 | 0 | 226 | 0 | 64 | 385 |
103eb7969b153576abaa873d17ec8cb2b8905540 | 49,081 | py | Python | src/syft/proto/grid/messages/dataset_messages_pb2.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | src/syft/proto/grid/messages/dataset_messages_pb2.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | src/syft/proto/grid/messages/dataset_messages_pb2.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/grid/messages/dataset_messages.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import re... | 33.872326 | 3,411 | 0.623031 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/grid/messages/dataset_messages.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0 |
8a45bc13240aad437a6179c942d5bebc1efc34c3 | 49,662 | py | Python | src/transformers/modeling_tf_distilbert.py | leogao2/transformers | 850197d888375135157cfcf3d795007849420e07 | [
"Apache-2.0"
] | 1 | 2021-04-20T17:01:32.000Z | 2021-04-20T17:01:32.000Z | src/transformers/modeling_tf_distilbert.py | leogao2/transformers | 850197d888375135157cfcf3d795007849420e07 | [
"Apache-2.0"
] | null | null | null | src/transformers/modeling_tf_distilbert.py | leogao2/transformers | 850197d888375135157cfcf3d795007849420e07 | [
"Apache-2.0"
] | 1 | 2020-09-10T21:01:41.000Z | 2020-09-10T21:01:41.000Z | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | 45.898336 | 161 | 0.66425 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | 0 | 28,277 | 0 | 14,362 | 0 | 0 | 0 | 403 | 432 |
a78f8d1a0138c8fa74ca70c5cb32e3c25570a937 | 1,369 | py | Python | main.py | FundingCircle/json2html-flask | 8fdafbca9acb09d449c7dba9618e1881940fc77e | [
"MIT"
] | null | null | null | main.py | FundingCircle/json2html-flask | 8fdafbca9acb09d449c7dba9618e1881940fc77e | [
"MIT"
] | null | null | null | main.py | FundingCircle/json2html-flask | 8fdafbca9acb09d449c7dba9618e1881940fc77e | [
"MIT"
] | null | null | null | """
JSON 2 HTML convertor
=====================
(c) Varun Malhotra 2013
http://softvar.github.io
Original Source Code: https://github.com/softvar/json2html-flask
------------
LICENSE: MIT
--------
"""
# -*- coding: utf-8 -*-
import json
from flask import Flask
app = Flask(__name__)
if __name__ == '__main__':
... | 23.20339 | 112 | 0.672754 | """
JSON 2 HTML convertor
=====================
(c) Varun Malhotra 2013
http://softvar.github.io
Original Source Code: https://github.com/softvar/json2html-flask
------------
LICENSE: MIT
--------
"""
# -*- coding: utf-8 -*-
import json
import collections
import html.parser
from flask import json
from flask import... | 0 | 826 | 0 | 0 | 0 | 0 | 0 | 20 | 179 |
6efae192a5f8b3f57d1651cb80148ff02914d4c4 | 10,081 | py | Python | ordlookup/oleaut32.py | weiyangye/GetPECopyrightInfo | 08b74036cd5e881c0e71d0984dc172365ac842aa | [
"Info-ZIP"
] | 716 | 2015-01-01T14:41:11.000Z | 2022-03-28T06:51:50.000Z | ordlookup/oleaut32.py | weiyangye/GetPECopyrightInfo | 08b74036cd5e881c0e71d0984dc172365ac842aa | [
"Info-ZIP"
] | 266 | 2015-01-01T15:07:27.000Z | 2022-03-30T15:19:26.000Z | ordlookup/oleaut32.py | weiyangye/GetPECopyrightInfo | 08b74036cd5e881c0e71d0984dc172365ac842aa | [
"Info-ZIP"
] | 159 | 2015-01-01T16:19:44.000Z | 2022-03-21T21:55:34.000Z | ord_names = {
2:'SysAllocString',
3:'SysReAllocString',
4:'SysAllocStringLen',
5:'SysReAllocStringLen',
6:'SysFreeString',
7:'SysStringLen',
8:'VariantInit',
9:'VariantClear',
10:'VariantCopy',
11:'VariantCopyInd',
12:'VariantChangeType',
13:'VariantTimeToDosDateTime',
... | 25.139651 | 41 | 0.643984 | ord_names = {
2:'SysAllocString',
3:'SysReAllocString',
4:'SysAllocStringLen',
5:'SysReAllocStringLen',
6:'SysFreeString',
7:'SysStringLen',
8:'VariantInit',
9:'VariantClear',
10:'VariantCopy',
11:'VariantCopyInd',
12:'VariantChangeType',
13:'VariantTimeToDosDateTime',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
313c5b079ddff81130a19654cc682f569c5a0595 | 3,016 | py | Python | 3 - Preprocessing dataset for melody generation pt 1/code/preprocess.py | MauiDesign/Musikalkemistgenerating-melodies-with-rnn-lstm | b3976fe4726fbe6674ebb9f8be7ad5805dd97650 | [
"MIT"
] | 48 | 2020-05-12T08:05:41.000Z | 2022-03-30T15:52:32.000Z | 3 - Preprocessing dataset for melody generation pt 1/code/preprocess.py | MauiDesign/Musikalkemistgenerating-melodies-with-rnn-lstm | b3976fe4726fbe6674ebb9f8be7ad5805dd97650 | [
"MIT"
] | 1 | 2021-07-04T05:27:36.000Z | 2021-07-04T05:27:36.000Z | 3 - Preprocessing dataset for melody generation pt 1/code/preprocess.py | MauiDesign/Musikalkemistgenerating-melodies-with-rnn-lstm | b3976fe4726fbe6674ebb9f8be7ad5805dd97650 | [
"MIT"
] | 23 | 2020-06-09T13:22:22.000Z | 2022-03-31T03:07:59.000Z | import os
import music21 as m21
KERN_DATASET_PATH = "path/to/dataset"
# durations are expressed in quarter length
ACCEPTABLE_DURATIONS = [
0.25, # 16th note
0.5, # 8th note
0.75,
1.0, # quarter note
1.5,
2, # half note
3,
4 # whole note
]
def load_songs_in_kern(dataset_path):
"""... | 26 | 95 | 0.660477 | import os
import music21 as m21
KERN_DATASET_PATH = "path/to/dataset"
# durations are expressed in quarter length
ACCEPTABLE_DURATIONS = [
0.25, # 16th note
0.5, # 8th note
0.75,
1.0, # quarter note
1.5,
2, # half note
3,
4 # whole note
]
def load_songs_in_kern(dataset_path):
"""... | 0 | 0 | 0 | 0 | 0 | 492 | 0 | 0 | 23 |
1ab6765da0378e6ff736794ebd2af3aa773a342c | 103 | py | Python | Recommendations/CF/Movies/movies-cf-app-python/adapters/bigdata/spark/spark_submit/__init__.py | javakishore-veleti/Data-Tech-Stack-Solutions | e60120d19a7b5be53da688b9c6ba7daa2a7e1b3d | [
"MIT"
] | null | null | null | Recommendations/CF/Movies/movies-cf-app-python/adapters/bigdata/spark/spark_submit/__init__.py | javakishore-veleti/Data-Tech-Stack-Solutions | e60120d19a7b5be53da688b9c6ba7daa2a7e1b3d | [
"MIT"
] | null | null | null | Recommendations/CF/Movies/movies-cf-app-python/adapters/bigdata/spark/spark_submit/__init__.py | javakishore-veleti/Data-Tech-Stack-Solutions | e60120d19a7b5be53da688b9c6ba7daa2a7e1b3d | [
"MIT"
] | null | null | null | from adapters.bigdata.spark.spark_submit.cli_main import register_adapter_impl
register_adapter_impl() | 34.333333 | 78 | 0.893204 | from adapters.bigdata.spark.spark_submit.cli_main import register_adapter_impl
register_adapter_impl() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4fcbfb15a9f1919c3131271dad8e4c000be094f0 | 109 | py | Python | utils/ascii-sum.py | EvanHahn/brainfuck-web-app | 487cc274f056752494d7bea7013f05a3c89f6c09 | [
"Unlicense"
] | 120 | 2016-04-08T22:54:50.000Z | 2022-03-25T01:15:23.000Z | utils/ascii-sum.py | cascalheira/brainfuck-web-app | 487cc274f056752494d7bea7013f05a3c89f6c09 | [
"Unlicense"
] | null | null | null | utils/ascii-sum.py | cascalheira/brainfuck-web-app | 487cc274f056752494d7bea7013f05a3c89f6c09 | [
"Unlicense"
] | 14 | 2017-03-09T19:01:11.000Z | 2022-03-04T06:01:27.000Z | #!/usr/bin/env python
from sys import argv
result = 0
for c in argv[1]:
result += ord(c)
print(result)
| 12.111111 | 21 | 0.651376 | #!/usr/bin/env python
from sys import argv
result = 0
for c in argv[1]:
result += ord(c)
print(result)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3b7db7a58c84e313a87154255140d756d20d63db | 997 | py | Python | darksite/account/test/schema/test_log_in_mutation.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | null | null | null | darksite/account/test/schema/test_log_in_mutation.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | 46 | 2018-12-19T06:53:37.000Z | 2019-01-11T18:20:05.000Z | darksite/account/test/schema/test_log_in_mutation.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | null | null | null |
import pytest
from account import schema
def test_log_in_invalid_credentials(db):
"""
If the provided credentials don't match a user, an exception should
be raised.
"""
mutation = schema.LogIn()
with pytest.raises(Exception):
mutation.mutate(None, email="fake@example.com", password... | 24.317073 | 76 | 0.693079 | from unittest import mock
import pytest
from account import schema
class DummyInfo:
def __init__(self, context):
self.context = context
def test_log_in_invalid_credentials(db):
"""
If the provided credentials don't match a user, an exception should
be raised.
"""
mutation = schema.... | 0 | 532 | 0 | 59 | 0 | 0 | 0 | 4 | 68 |
0f28dba61d436119cb72e1ad578c4bc9a490ee0c | 50,377 | py | Python | examples/libtest/ClassTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 739 | 2015-01-01T02:05:11.000Z | 2022-03-30T15:26:16.000Z | examples/libtest/ClassTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 33 | 2015-03-25T23:17:04.000Z | 2021-08-19T08:25:22.000Z | examples/libtest/ClassTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 167 | 2015-01-01T22:27:47.000Z | 2022-03-17T13:29:19.000Z |
# syntax check
# import a, b, c
if True:
import imports.circ1
global names
names = {}
# testMetaClass
# testClassVars
# Global variable to test variable selection order
x = 'global test'
# testInheritedProperties
# testInheritedPropertyObjects
# testInheritedConstructors
# XXX doing this should throw a "... | 33.274108 | 184 | 0.603152 | import sys
from UnitTest import UnitTest, IN_BROWSER
# syntax check
# import a, b, c
if True:
import imports.circ1
from imports import exec_order, imports as IMPORTS
from imports import exec_order as EXEC_ORDER
import I18N
from imports.classes import WithAttribute
import imports.decors # must be in this form
gl... | 0 | 969 | 0 | 45,420 | 0 | 964 | 0 | 71 | 1,816 |
5245ec313baa01b218b015463d7468714caad528 | 14,647 | py | Python | dualbound/Arnoldi/shell_Green_Taylor_Arnoldi_spatialDiscretization_mp.py | PengningChao/emdb-sphere | d20ac81ab4fd744f87788bda46d3aa19598658ee | [
"MIT"
] | null | null | null | dualbound/Arnoldi/shell_Green_Taylor_Arnoldi_spatialDiscretization_mp.py | PengningChao/emdb-sphere | d20ac81ab4fd744f87788bda46d3aa19598658ee | [
"MIT"
] | null | null | null | dualbound/Arnoldi/shell_Green_Taylor_Arnoldi_spatialDiscretization_mp.py | PengningChao/emdb-sphere | d20ac81ab4fd744f87788bda46d3aa19598658ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 5 21:46:50 2020
@author: pengning
"""
import numpy as np
from mpmath import mp
from .spherical_Green_Taylor_Arnoldi_speedup import mp_re
from .shell_Green_Taylor_Arnoldi_spatialDiscretization import grid_integrate_trap, rgrid_Mmn_plot, rgrid_Nmn_p... | 48.339934 | 242 | 0.709429 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 5 21:46:50 2020
@author: pengning
"""
import numpy as np
import scipy.special as sp
import matplotlib.pyplot as plt
from .shell_domain import shell_rho_M, shell_rho_N
import mpmath
from mpmath import mp
from .dipole_field import mp_spherical_jn, m... | 0 | 0 | 0 | 0 | 0 | 7,075 | 0 | 179 | 187 |
dd1d64b45d54b14818bed0cb693ce901fbcacf2d | 608 | py | Python | apps/booking/migrations/0002_auto_20210306_1210.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | apps/booking/migrations/0002_auto_20210306_1210.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | apps/booking/migrations/0002_auto_20210306_1210.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-03-06 12:10
| 25.333333 | 86 | 0.595395 | # Generated by Django 3.1.4 on 2021-03-06 12:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('booking', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='room',
name='description_de',
... | 0 | 0 | 0 | 494 | 0 | 0 | 0 | 19 | 46 |
8368dcc980f0f55291ed6b124a6dcb787dbb823c | 11,429 | py | Python | fastNLP/api/api.py | YanLiqi/fastNLP | a8c45796158a3b8dbc81e22412bd6e4e4b97539a | [
"Apache-2.0"
] | 4 | 2019-01-19T13:58:10.000Z | 2019-01-19T15:07:48.000Z | fastNLP/api/api.py | YanLiqi/fastNLP | a8c45796158a3b8dbc81e22412bd6e4e4b97539a | [
"Apache-2.0"
] | null | null | null | fastNLP/api/api.py | YanLiqi/fastNLP | a8c45796158a3b8dbc81e22412bd6e4e4b97539a | [
"Apache-2.0"
] | null | null | null | import warnings
warnings.filterwarnings('ignore')
# TODO add pretrain urls
model_urls = {
"cws": "http://123.206.98.91:8888/download/cws_crf_1_11-457fc899.pkl",
"pos": "http://123.206.98.91:8888/download/pos_tag_model_20190108-f3c60ee5.pkl",
"parser": "http://123.206.98.91:8888/download/biaffine_parser-3a... | 34.218563 | 117 | 0.584391 | import warnings
import torch
warnings.filterwarnings('ignore')
import os
from fastNLP.core.dataset import DataSet
from fastNLP.api.utils import load_url
from fastNLP.api.processor import ModelProcessor
from reproduction.chinese_word_segment.cws_io.cws_reader import ConllCWSReader
from reproduction.pos_tag_model.pos... | 753 | 0 | 0 | 10,160 | 0 | 0 | 0 | 297 | 382 |
7111b1a2c76d6630b980fbd687a898d741e2754a | 27,468 | py | Python | code/cctp.py | progami/CCTP | 37a35cb46d0d449c8bfc1e494432f4aac4a2e84f | [
"Unlicense"
] | null | null | null | code/cctp.py | progami/CCTP | 37a35cb46d0d449c8bfc1e494432f4aac4a2e84f | [
"Unlicense"
] | null | null | null | code/cctp.py | progami/CCTP | 37a35cb46d0d449c8bfc1e494432f4aac4a2e84f | [
"Unlicense"
] | 1 | 2021-02-01T19:37:57.000Z | 2021-02-01T19:37:57.000Z | import logging
import os
import time
import warnings
from colorama import init
# noinspection PyUnresolvedReferences
init(convert=True)
warnings.filterwarnings("ignore")
log_file = os.path.join(os.getcwd(), 'logs', str(time.strftime('%Y %m %d %H')) + ' activity.log')
logging.basicConfig(filename=log_file, level=loggi... | 45.78 | 120 | 0.594 | import decimal
import logging
import os
import smtplib
import time
import warnings
from datetime import datetime
import pandas as pd
import zmq
from binance.client import Client
from coinmarketcap import Market
from colorama import init, Fore, Back, Style
# noinspection PyUnresolvedReferences
from sentimentAnalyse impo... | 0 | 253 | 0 | 26,321 | 0 | 0 | 0 | 47 | 222 |
0ebeaa3edc54cfb4230c1f81934806f7230fbd87 | 144 | py | Python | app/main/__init__.py | Alexotieno1717/pitch | 103996667ed7a69aff1b9d3ca84f7546444fce58 | [
"MIT"
] | 1 | 2020-09-21T07:02:27.000Z | 2020-09-21T07:02:27.000Z | app/main/__init__.py | Alexotieno1717/pitch | 103996667ed7a69aff1b9d3ca84f7546444fce58 | [
"MIT"
] | null | null | null | app/main/__init__.py | Alexotieno1717/pitch | 103996667ed7a69aff1b9d3ca84f7546444fce58 | [
"MIT"
] | null | null | null | from flask import Blueprint
main = Blueprint('main', __name__)
# try:
# except:
# print('*'*50,"Error","*"*50)
| 16 | 34 | 0.652778 | from flask import Blueprint
main = Blueprint('main', __name__)
# try:
from app.main import views
# except:
# print('*'*50,"Error","*"*50)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
4e7ea87e00c20a20918afd2226e47c3ff0b5664e | 14,412 | py | Python | sqltills/parsetree.py | Moro-Code/SQLTills | 65ba0b77bc3850ac88029e417064005418570987 | [
"MIT"
] | null | null | null | sqltills/parsetree.py | Moro-Code/SQLTills | 65ba0b77bc3850ac88029e417064005418570987 | [
"MIT"
] | null | null | null | sqltills/parsetree.py | Moro-Code/SQLTills | 65ba0b77bc3850ac88029e417064005418570987 | [
"MIT"
] | null | null | null | """
this module contains the neccesary datastructures that are used by the utility functions in the cruds module
Contents
--------
Expression
This class is used to construct a function with the specified expression
"""
#types used to give type hintings wherever possible
#the sqlalchemy DeclarativeMeta class is i... | 47.407895 | 161 | 0.588815 | """
this module contains the neccesary datastructures that are used by the utility functions in the cruds module
Contents
--------
Expression
This class is used to construct a function with the specified expression
"""
#types used to give type hintings wherever possible
import typing
#the sqlalchemy DeclarativeM... | 0 | 0 | 0 | 13,706 | 0 | 0 | 0 | 67 | 154 |
a3a2ade6e36fd50c18e3023466a85b252ba5b679 | 5,206 | py | Python | modules/demo/graph/python/convert_matrix.py | AjayThorve/rapids-js-1 | 48aa0baf849e802f595bc2ae054ebdde8b57fc8c | [
"Apache-2.0"
] | 1 | 2021-06-24T23:08:49.000Z | 2021-06-24T23:08:49.000Z | modules/demo/graph/python/convert_matrix.py | AjayThorve/rapids-js-1 | 48aa0baf849e802f595bc2ae054ebdde8b57fc8c | [
"Apache-2.0"
] | null | null | null | modules/demo/graph/python/convert_matrix.py | AjayThorve/rapids-js-1 | 48aa0baf849e802f595bc2ae054ebdde8b57fc8c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 43.383333 | 94 | 0.619862 | # Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 | 0 | 0 | 0 | 0 | 3,816 | 0 | -13 | 207 |
d89ee534dab95a3edfc25ef43d8063f70878a6a3 | 1,800 | py | Python | Probability Calculator/prob_calculator.py | thevirtualbuddy/Python-freecodecamp | fb6ea19385da68ba4c8735024ada4a1eae3074d0 | [
"MIT"
] | null | null | null | Probability Calculator/prob_calculator.py | thevirtualbuddy/Python-freecodecamp | fb6ea19385da68ba4c8735024ada4a1eae3074d0 | [
"MIT"
] | null | null | null | Probability Calculator/prob_calculator.py | thevirtualbuddy/Python-freecodecamp | fb6ea19385da68ba4c8735024ada4a1eae3074d0 | [
"MIT"
] | null | null | null | # Consider using the modules imported above.
| 29.508197 | 90 | 0.601111 | import copy
import random
# Consider using the modules imported above.
class Hat:
def __init__(self, **kwargs):
self.Originalcontents = dict()
self.contents = []
for key, value in kwargs.items():
self.Originalcontents[key]=value
for i in range(value):
... | 0 | 0 | 0 | 643 | 0 | 1,031 | 0 | -18 | 90 |
4d50f23be5fa23de4c485b333a22295e42a4c1dc | 509 | py | Python | tests/acceptance/test_account_settings.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | 1 | 2018-03-05T15:40:12.000Z | 2018-03-05T15:40:12.000Z | tests/acceptance/test_account_settings.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | 8 | 2019-12-28T23:49:55.000Z | 2022-03-02T04:34:18.000Z | tests/acceptance/test_account_settings.py | zaasmi/codeerrorhelp | 1ab8d3e314386b9b2d58dad9df45355bf6014ac9 | [
"BSD-3-Clause"
] | 2 | 2021-01-26T09:53:39.000Z | 2022-03-22T09:01:47.000Z | from __future__ import absolute_import
| 29.941176 | 57 | 0.705305 | from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase
class AccountSettingsTest(AcceptanceTestCase):
def setUp(self):
super(AccountSettingsTest, self).setUp()
self.user = self.create_user('foo@example.com')
self.login_as(self.user)
self.path = '/ac... | 0 | 0 | 0 | 397 | 0 | 0 | 0 | 26 | 46 |
1baa095d1373f3e2ca29897fc3b861c778187db3 | 4,058 | py | Python | kivy/tests/test_uix_stacklayout.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 13,889 | 2015-01-01T06:43:41.000Z | 2022-03-31T17:37:56.000Z | kivy/tests/test_uix_stacklayout.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 4,570 | 2015-01-01T17:58:52.000Z | 2022-03-31T18:42:16.000Z | kivy/tests/test_uix_stacklayout.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 3,786 | 2015-01-01T09:20:45.000Z | 2022-03-30T21:15:05.000Z | '''
uix.stacklayout tests
=====================
'''
| 33.53719 | 74 | 0.561853 | '''
uix.stacklayout tests
=====================
'''
import unittest
from kivy.uix.stacklayout import StackLayout
from kivy.uix.widget import Widget
class UixStackLayoutTest(unittest.TestCase):
def test_stacklayout_no_children(self):
sl = StackLayout()
sl.do_layout()
def test_stacklayout_de... | 0 | 0 | 0 | 3,884 | 0 | 0 | 0 | 30 | 91 |
1a3b05d93297931d9a07f0d409ff4332d52b0801 | 3,482 | py | Python | django_sso_app/core/authentication/middleware/base.py | paiuolo/django-sso-app | 75b96c669dc0b176dc77e08f018a3e97d259f636 | [
"MIT"
] | 1 | 2021-11-16T15:16:08.000Z | 2021-11-16T15:16:08.000Z | django_sso_app/core/authentication/middleware/base.py | paiuolo/django-sso-app | 75b96c669dc0b176dc77e08f018a3e97d259f636 | [
"MIT"
] | null | null | null | django_sso_app/core/authentication/middleware/base.py | paiuolo/django-sso-app | 75b96c669dc0b176dc77e08f018a3e97d259f636 | [
"MIT"
] | null | null | null | import logging
from django.urls import reverse
# -exception-middleware-typeerror-object-takes-no-parameters
from django.conf import settings
from ... import app_settings
logger = logging.getLogger('django_sso_app')
ADMIN_URL = '/{}'.format(getattr(settings, 'ADMI... | 41.452381 | 114 | 0.696439 | import logging
from django.contrib import auth
from django.urls import reverse
from django.utils.deprecation import MiddlewareMixin # https://stackoverflow.com/questions/42232606/django
# -exception-middleware-typeerror-object-takes-no-parameters
from django.conf ... | 0 | 1,713 | 0 | 1,009 | 0 | 0 | 0 | 78 | 168 |
7ea0731e7b6e04efd9653597929b263532f95e7f | 5,117 | py | Python | link_shortener/api/tests/test_api_retrieve.py | vojta-janousek/link-shortener | 1462a62b9a505d043291b3ccd03afbb709535600 | [
"MIT"
] | null | null | null | link_shortener/api/tests/test_api_retrieve.py | vojta-janousek/link-shortener | 1462a62b9a505d043291b3ccd03afbb709535600 | [
"MIT"
] | null | null | null | link_shortener/api/tests/test_api_retrieve.py | vojta-janousek/link-shortener | 1462a62b9a505d043291b3ccd03afbb709535600 | [
"MIT"
] | 1 | 2020-08-07T11:16:05.000Z | 2020-08-07T11:16:05.000Z | '''
Copyright (C) 2020 Link Shortener Authors (see AUTHORS in Documentation).
Licensed under the MIT (Expat) License (see LICENSE in Documentation).
'''
| 33.444444 | 78 | 0.624976 | '''
Copyright (C) 2020 Link Shortener Authors (see AUTHORS in Documentation).
Licensed under the MIT (Expat) License (see LICENSE in Documentation).
'''
from decouple import config
from unittest import TestCase
from json import loads
from link_shortener.server import create_app
class TestRetrieveLinksAPI(TestCase):... | 0 | 0 | 0 | 4,788 | 0 | 0 | 0 | 38 | 136 |
90692882a79f4eef6affd5d58e67200f97d7366a | 301 | py | Python | venv/Lib/site-packages/tensorflow/keras/estimator/__init__.py | caiovini/Image_reader_api | 7fae630a17195d3415eb739278ef21a3b58cae76 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/keras/estimator/__init__.py | caiovini/Image_reader_api | 7fae630a17195d3415eb739278ef21a3b58cae76 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/tensorflow/keras/estimator/__init__.py | caiovini/Image_reader_api | 7fae630a17195d3415eb739278ef21a3b58cae76 | [
"MIT"
] | null | null | null | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""Home of estimator related functions.
"""
from __future__ import print_function
del print_function
| 25.083333 | 75 | 0.817276 | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""Home of estimator related functions.
"""
from __future__ import print_function
from tensorflow.python.estimator.estimator_lib import model_to_estimator
del print_function
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 51 | 23 |
951c166cc63dde88465dc6e4e067b684760cd2b3 | 15,417 | py | Python | utils/scripts/OOOlevelGen/src/LevelBuilder.py | fullscreennl/bullettime | 8967449cdf926aaed6bb7ec217d92e0689fb0c3c | [
"MIT"
] | null | null | null | utils/scripts/OOOlevelGen/src/LevelBuilder.py | fullscreennl/bullettime | 8967449cdf926aaed6bb7ec217d92e0689fb0c3c | [
"MIT"
] | null | null | null | utils/scripts/OOOlevelGen/src/LevelBuilder.py | fullscreennl/bullettime | 8967449cdf926aaed6bb7ec217d92e0689fb0c3c | [
"MIT"
] | null | null | null |
LEVEL = """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>scrollmode</key>
<integer>%(scrollmode)s</integer>
<key>level</key>
<dict>
<key>name</key>
<strin... | 36.360849 | 243 | 0.574042 | import os
import config
from sprites import *
from sprite_templates import *
import traceback
from xml.dom.minidom import parseString
import sys
LEVEL = """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.... | 0 | 0 | 0 | 4,348 | 0 | 0 | 0 | -9 | 208 |
bac6abe5625493532e6b8e6c51c6549f943ccc10 | 11,571 | py | Python | server/ai/src/learnUltimo.py | ChuVal/Respaldo2 | 0e5c8ad2ca7084eae3c907950188218c44acef46 | [
"MIT"
] | null | null | null | server/ai/src/learnUltimo.py | ChuVal/Respaldo2 | 0e5c8ad2ca7084eae3c907950188218c44acef46 | [
"MIT"
] | null | null | null | server/ai/src/learnUltimo.py | ChuVal/Respaldo2 | 0e5c8ad2ca7084eae3c907950188218c44acef46 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import logging
#Librerias locindoor
# create logger with 'spam_application'
logger = logging.getLogger('learn')
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler('learn.log')
fh.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter(
... | 35.603077 | 117 | 0.522945 | #!/usr/bin/python3
import io
import csv
import json
import warnings
import pickle
import operator
import time
import logging
import math
import functools
import numpy
from sklearn.preprocessing import MinMaxScaler
from threading import Thread
from random import shuffle
from sklearn.neural_network import MLPClassifier
... | 2 | 3,192 | 0 | 6,760 | 0 | 89 | 0 | 288 | 751 |
5231c3167b920cec661de41fdb187267c70ca933 | 14,138 | py | Python | test/test_auth.py | C2Devel/mongo-python-driver | 7b090b9c89a52504ac85af6028a52a4a4af35221 | [
"Apache-2.0"
] | null | null | null | test/test_auth.py | C2Devel/mongo-python-driver | 7b090b9c89a52504ac85af6028a52a4a4af35221 | [
"Apache-2.0"
] | null | null | null | test/test_auth.py | C2Devel/mongo-python-driver | 7b090b9c89a52504ac85af6028a52a4a4af35221 | [
"Apache-2.0"
] | 1 | 2018-10-19T09:05:26.000Z | 2018-10-19T09:05:26.000Z | # Copyright 2013 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 43.103659 | 82 | 0.580422 | # Copyright 2013 10gen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 0 | 0 | 0 | 12,515 | 0 | 0 | 0 | 174 | 316 |
ed252e3dc09df339dd1a38f6aebfba451a1e5444 | 1,867 | py | Python | research/cv/FaceAttribute/src/far_process_RWMF.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/FaceAttribute/src/far_process_RWMF.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/FaceAttribute/src/far_process_RWMF.py | mindspore-ai/models | 9127b128e2961fd698977e918861dadfad00a44c | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.586957 | 78 | 0.569898 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b1912b1998b3e837c525f03cf0cd5cb93731c41a | 515 | py | Python | load_model_weights.py | kkleidal/kens_tf_utils | b650475bceec4221044dabc9a2c219bf281672d0 | [
"MIT"
] | 1 | 2019-02-19T16:09:56.000Z | 2019-02-19T16:09:56.000Z | load_model_weights.py | kkleidal/kens_tf_utils | b650475bceec4221044dabc9a2c219bf281672d0 | [
"MIT"
] | null | null | null | load_model_weights.py | kkleidal/kens_tf_utils | b650475bceec4221044dabc9a2c219bf281672d0 | [
"MIT"
] | 2 | 2018-05-28T15:49:01.000Z | 2021-02-09T13:12:14.000Z | #!/usr/bin/env python3
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='See what variables are stored in model.npy file')
parser.add_argument('load_from', metavar='LOAD_FROM', type=str,
help='the model.npy file')
args = parser.parse_args()
... | 32.1875 | 99 | 0.650485 | #!/usr/bin/env python3
from model_weights import *
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='See what variables are stored in model.npy file')
parser.add_argument('load_from', metavar='LOAD_FROM', type=str,
help='the model.npy file')
a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 23 |
99f138966bc8b9deb592e8bfa9dfa1ff5c8e4c15 | 4,080 | py | Python | test_pylibCZIrw.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | 3 | 2020-12-31T10:06:42.000Z | 2021-11-09T13:44:16.000Z | test_pylibCZIrw.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | null | null | null | test_pylibCZIrw.py | sebi06/czi_demos | b3f7801f46de0138a8a1ac245e9c80787e0a3f17 | [
"MIT"
] | null | null | null | from czifiletools import pylibCZIrw_tools as cztrw
from pylibCZIrw import czi as pyczi
#from pylibCZIrw import Rectangle
from matplotlib import pyplot as plt
#filename = r'd:\Testdata_Zeiss\CZI_Testfiles\Z=4_CH=2.czi'
#filename = r'd:\Testdata_Zeiss\CZI_Testfiles\T=3_Z=4_CH=2.czi'
#filename = r'd:\Testdata_Zeiss\CZI_... | 53.684211 | 115 | 0.797304 | from czifiletools import pylibCZIrw_tools as cztrw
from pylibCZIrw import czi as pyczi
#from pylibCZIrw import Rectangle
from matplotlib import pyplot as plt
#filename = r'd:\Testdata_Zeiss\CZI_Testfiles\Z=4_CH=2.czi'
#filename = r'd:\Testdata_Zeiss\CZI_Testfiles\T=3_Z=4_CH=2.czi'
#filename = r'd:\Testdata_Zeiss\CZI_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
565a31ec52be1c9a1b57b11a69e58240cf73dd33 | 3,964 | py | Python | python_hyperscope/utils.py | momonala/hyperscope | 2dafe0946235090b0e799014e7f5de6c04881cf5 | [
"MIT"
] | 1 | 2022-01-14T07:12:48.000Z | 2022-01-14T07:12:48.000Z | python_hyperscope/utils.py | momonala/hyperscope | 2dafe0946235090b0e799014e7f5de6c04881cf5 | [
"MIT"
] | 1 | 2021-10-12T22:51:31.000Z | 2021-10-12T22:51:31.000Z | python_hyperscope/utils.py | momonala/hyperscope | 2dafe0946235090b0e799014e7f5de6c04881cf5 | [
"MIT"
] | null | null | null | """Helper functions for generating panoramics."""
import logging
import os
from contextlib import redirect_stderr
from glob import glob
from shutil import copyfile
import cv2
import numpy as np
import psutil
from tqdm import tqdm
logger = logging.getLogger(__name__)
def prepare_directories_for_stitching_in_rows(inp... | 31.212598 | 101 | 0.681382 | """Helper functions for generating panoramics."""
import logging
import os
from contextlib import redirect_stderr
from glob import glob
from shutil import copyfile
import cv2
import numpy as np
import psutil
from tqdm import tqdm
logger = logging.getLogger(__name__)
def prepare_directories_for_stitching_in_rows(inp... | 0 | 0 | 0 | 0 | 0 | 650 | 0 | 0 | 46 |
4edfc6347476f37596746b098f4e82be0e6656bc | 2,111 | py | Python | endochrone/decomposition/undersampling.py | nickwood/endochrone | 050a2604be82ee4cd5ee6357ea72d3d6d4117277 | [
"MIT"
] | 2 | 2020-04-20T15:41:53.000Z | 2021-11-25T18:52:20.000Z | endochrone/decomposition/undersampling.py | nickwood/endochrone | 050a2604be82ee4cd5ee6357ea72d3d6d4117277 | [
"MIT"
] | null | null | null | endochrone/decomposition/undersampling.py | nickwood/endochrone | 050a2604be82ee4cd5ee6357ea72d3d6d4117277 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = "nickwood"
__copyright__ = "nickwood"
__license__ = "mit"
| 34.048387 | 79 | 0.5964 | # -*- coding: utf-8 -*-
from collections import defaultdict
import numpy as np
from endochrone import Base, Transformer
from endochrone.stats.measures import arg_nearest
__author__ = "nickwood"
__copyright__ = "nickwood"
__license__ = "mit"
class TomekLinks(Base, Transformer):
def __init__(self):
super(... | 0 | 0 | 0 | 1,712 | 0 | 108 | 0 | 58 | 135 |
94c398cb093ac494704fa019ee112bd723e9d121 | 3,173 | py | Python | spinup/my_env/rtd/utils/robot_plot.py | muzi2018/DRL_RTD | 518100c4c48f66fd38ef9877f3e4903c9cc2a237 | [
"MIT"
] | null | null | null | spinup/my_env/rtd/utils/robot_plot.py | muzi2018/DRL_RTD | 518100c4c48f66fd38ef9877f3e4903c9cc2a237 | [
"MIT"
] | null | null | null | spinup/my_env/rtd/utils/robot_plot.py | muzi2018/DRL_RTD | 518100c4c48f66fd38ef9877f3e4903c9cc2a237 | [
"MIT"
] | null | null | null | import matplotlib.animation as animation
| 30.219048 | 108 | 0.598802 | import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.patches import Circle
import numpy as np
import time
from rtd.simulator_files.planner.planner import get_env
from rtd.simulator_files.planner.planner import astar_planning
def plot_robot_and_obstacles(robot, obstacles, robot_ra... | 12 | 0 | 0 | 0 | 0 | 2,858 | 0 | 88 | 179 |
ff92ec13ffa6d364097db1db2973673b5c2e828a | 4,763 | py | Python | rebiber/arxiv.py | EntilZha/rebiber | 88c9fbef12cae73e2ed6f67ee6f32f39040f8299 | [
"MIT"
] | null | null | null | rebiber/arxiv.py | EntilZha/rebiber | 88c9fbef12cae73e2ed6f67ee6f32f39040f8299 | [
"MIT"
] | null | null | null | rebiber/arxiv.py | EntilZha/rebiber | 88c9fbef12cae73e2ed6f67ee6f32f39040f8299 | [
"MIT"
] | null | null | null | import typer
from rich.console import Console
console = Console()
app = typer.Typer()
if __name__ == "__main__":
app()
| 35.022059 | 118 | 0.617258 | import json
import os
import pickle
from typing import Dict
import bibtexparser
import typer
from functional import pseq
from rich.console import Console
from rebiber.bib2json import normalize_title
console = Console()
app = typer.Typer()
def construct_paper_db(bib_list_file, start_dir=""):
with open(bib_list... | 0 | 2,654 | 0 | 0 | 0 | 1,683 | 0 | -1 | 294 |
aa9ad9646751dbd6146f27b0de601b1ba359fdb3 | 2,183 | py | Python | resources/rest-service/cloudify/migrations/versions/3483e421713d_rename_availability_to_visibility.py | TS-at-WS/cloudify-manager | 3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc | [
"Apache-2.0"
] | null | null | null | resources/rest-service/cloudify/migrations/versions/3483e421713d_rename_availability_to_visibility.py | TS-at-WS/cloudify-manager | 3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc | [
"Apache-2.0"
] | 1 | 2021-03-26T00:32:30.000Z | 2021-03-26T00:32:30.000Z | resources/rest-service/cloudify/migrations/versions/3483e421713d_rename_availability_to_visibility.py | TS-at-WS/cloudify-manager | 3e062e8dec16c89d2ab180d0b761cbf76d3f7ddc | [
"Apache-2.0"
] | 1 | 2019-11-24T12:07:18.000Z | 2019-11-24T12:07:18.000Z | """<changes description>
Revision ID: 3483e421713d
Revises: 784a82cec07a
Create Date: 2017-12-27 12:29:26.302823
"""
# revision identifiers, used by Alembic.
revision = '3483e421713d'
down_revision = '784a82cec07a'
branch_labels = None
depends_on = None
resource_tables = ['blueprints', 'plugins', 'secrets', 'snapsh... | 37 | 77 | 0.62437 | """<changes description>
Revision ID: 3483e421713d
Revises: 784a82cec07a
Create Date: 2017-12-27 12:29:26.302823
"""
from alembic import op
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '3483e421713d'
down_revision = '784a82cec07a'
branch_labels = None
depends_on = No... | 0 | 0 | 0 | 0 | 0 | 1,456 | 0 | 22 | 90 |
3cbb7bfe0204b679f4f7a39d3adb1c29429c2065 | 732 | py | Python | cla_backend/apps/legalaid/fields.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 3 | 2019-10-02T15:31:03.000Z | 2022-01-13T10:15:53.000Z | cla_backend/apps/legalaid/fields.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 206 | 2015-01-02T16:50:11.000Z | 2022-02-16T20:16:05.000Z | cla_backend/apps/legalaid/fields.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 6 | 2015-03-23T23:08:42.000Z | 2022-02-15T17:04:44.000Z | # coding=utf-8
| 33.272727 | 75 | 0.677596 | # coding=utf-8
from django.core import validators
from django.db import models
class MoneyField(models.BigIntegerField):
"""
Stores money to nearest penny as integer. e.g. £10.22 would be 1022
"""
def __init__(self, max_value=9999999999, min_value=0, *args, **kwargs):
self.max_value, self.min... | 2 | 0 | 0 | 628 | 0 | 0 | 0 | 20 | 67 |
0c37f57ac031e4fa16b15ec0b67f6c301cb09f2a | 4,456 | py | Python | locust_swarm.py | cds-snc/gc_forms_load_testing | adb1217b36e10047e0470b4de2e47033517f91f8 | [
"MIT"
] | null | null | null | locust_swarm.py | cds-snc/gc_forms_load_testing | adb1217b36e10047e0470b4de2e47033517f91f8 | [
"MIT"
] | null | null | null | locust_swarm.py | cds-snc/gc_forms_load_testing | adb1217b36e10047e0470b4de2e47033517f91f8 | [
"MIT"
] | null | null | null | import logging
import json
from invokust.aws_lambda import LambdaLoadTest
logging.basicConfig(level=logging.INFO)
###
# SETTINGS
###
# How long should the test run for in minutes?
# Note that Lambda invokations that are started cannot be stopped.
# Test times will actually be run in intervals of 3 minutes.
test_time... | 32.764706 | 133 | 0.569794 | import logging
import json
from invokust.aws_lambda import LambdaLoadTest, results_aggregator
logging.basicConfig(level=logging.INFO)
###
# SETTINGS
###
# How long should the test run for in minutes?
# Note that Lambda invokations that are started cannot be stopped.
# Test times will actually be run in intervals of ... | 0 | 0 | 0 | 0 | 0 | 3,186 | 0 | 20 | 46 |
32f94f0e04e74417a0b5b4dba0f7e5305467b33a | 968 | py | Python | Leetcode/1261. Find Elements in a Contaminated Binary Tree/solution3.py | asanoviskhak/Outtalent | c500e8ad498f76d57eb87a9776a04af7bdda913d | [
"MIT"
] | 51 | 2020-07-12T21:27:47.000Z | 2022-02-11T19:25:36.000Z | Leetcode/1261. Find Elements in a Contaminated Binary Tree/solution3.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | null | null | null | Leetcode/1261. Find Elements in a Contaminated Binary Tree/solution3.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | 32 | 2020-07-27T13:54:24.000Z | 2021-12-25T18:12:50.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# Your FindElements object will be instantiated and called as such:
# obj = FindElements(root)
# param_1 = obj.find(target)
| 23.609756 | 67 | 0.510331 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class FindElements:
def __init__(self, root: TreeNode):
self.root = root
def find(self, target: int) -> bool:
... | 0 | 0 | 0 | 629 | 0 | 0 | 0 | 0 | 22 |
6a58caddeaa88858a276b0327694acf19c4961f2 | 17,431 | py | Python | DQMOffline/Trigger/python/JetMonitor_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | DQMOffline/Trigger/python/JetMonitor_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | DQMOffline/Trigger/python/JetMonitor_cff.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.JetMonitor_cfi import hltJetMETmonitoring
### HLT_PFJet Triggers ###
# HLT_PFJet450
PFJet450_Prommonitoring = hltJetMETmonitoring.clone(
FolderName = 'HLT/JME/Jets/AK4/PF/HLT_PFJet450/',
histoPSet = dict(jetPtThrPSet = dict(
nbin... | 31.016014 | 79 | 0.626527 | import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.JetMonitor_cfi import hltJetMETmonitoring
### HLT_PFJet Triggers ###
# HLT_PFJet450
PFJet450_Prommonitoring = hltJetMETmonitoring.clone(
FolderName = 'HLT/JME/Jets/AK4/PF/HLT_PFJet450/',
histoPSet = dict(jetPtThrPSet = dict(
nbin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
285263ee501a2ee950825d8fbdac1f046b745c19 | 1,289 | py | Python | exceRNApipeline/tests/test_pipeline/test_pipeline_init.py | zhuchcn/exceRNAseq | 14e1e35962fffb70c9ee7c494e2c7c1955ff3945 | [
"MIT"
] | 1 | 2019-11-26T02:41:11.000Z | 2019-11-26T02:41:11.000Z | exceRNApipeline/tests/test_pipeline/test_pipeline_init.py | zhuchcn/exceRNAseq | 14e1e35962fffb70c9ee7c494e2c7c1955ff3945 | [
"MIT"
] | null | null | null | exceRNApipeline/tests/test_pipeline/test_pipeline_init.py | zhuchcn/exceRNAseq | 14e1e35962fffb70c9ee7c494e2c7c1955ff3945 | [
"MIT"
] | 1 | 2019-11-26T02:42:07.000Z | 2019-11-26T02:42:07.000Z | import os
_FILE_DIR = os.path.dirname(__file__)
_TEMP_DIR = os.path.join(_FILE_DIR, "_test_tmp") | 35.805556 | 87 | 0.662529 | import exceRNApipeline.pipeline.__main__ as pipeline
from unittest import TestCase
import sys
import os
import shutil
_FILE_DIR = os.path.dirname(__file__)
_TEMP_DIR = os.path.join(_FILE_DIR, "_test_tmp")
class TestCasePipelineInit(TestCase):
def setUp(self):
super().setUp()
self.sys_argv = sys.a... | 0 | 0 | 0 | 1,060 | 0 | 0 | 0 | 20 | 111 |
62bc41440bcafabd712be0aad7dcc6f584123ce9 | 2,110 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/clock/test_clock_turn_on_off_alarm.py | ibrahimasarr/gaia | 23b7a2e53a356356f8e082ba17e2dcb35c1950fe | [
"Apache-2.0"
] | 3 | 2015-08-31T15:24:31.000Z | 2020-04-24T20:31:29.000Z | tests/python/gaia-ui-tests/gaiatest/tests/clock/test_clock_turn_on_off_alarm.py | ganesh7/gaia | 32112b10072e82ac8d52be891d09685f8eaa02f8 | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/tests/clock/test_clock_turn_on_off_alarm.py | ganesh7/gaia | 32112b10072e82ac8d52be891d09685f8eaa02f8 | [
"Apache-2.0"
] | 3 | 2015-07-29T07:17:15.000Z | 2020-11-04T06:55:37.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
| 39.811321 | 121 | 0.726066 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.tests.clock import clock_object
import time
class TestClockTurnOnOffAl... | 0 | 0 | 0 | 1,794 | 0 | 0 | 0 | 26 | 90 |
4c8677e38052c00dda4b7ea9057cda5aec79a133 | 487 | py | Python | test_scripts/Barcode/barcode_gen.py | WarriorSubha/Smart-Library | aa8c6f54c02c9ca2846fcc87bf68f1b81f4fd5b6 | [
"MIT"
] | 1 | 2020-03-19T00:06:10.000Z | 2020-03-19T00:06:10.000Z | test_scripts/Barcode/barcode_gen.py | WarriorSubha/Smart-Library | aa8c6f54c02c9ca2846fcc87bf68f1b81f4fd5b6 | [
"MIT"
] | 10 | 2019-09-07T20:01:07.000Z | 2019-10-31T06:27:40.000Z | test_scripts/Barcode/barcode_gen.py | WarriorSubha/Smart-Library | aa8c6f54c02c9ca2846fcc87bf68f1b81f4fd5b6 | [
"MIT"
] | 3 | 2019-09-05T09:06:36.000Z | 2019-10-24T17:45:20.000Z | import requests, socket
import barcode
from barcode.writer import ImageWriter
c128 = barcode.get_barcode_class('CODE128')
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
url = 'http://{}:5000'.format(host_ip)
res = requests.get('{}/get_all_books'.format(url))
if res.status_code == 200:
bo... | 24.35 | 61 | 0.712526 | import requests, socket
import barcode
from barcode.writer import ImageWriter
c128 = barcode.get_barcode_class('CODE128')
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
url = 'http://{}:5000'.format(host_ip)
res = requests.get('{}/get_all_books'.format(url))
if res.status_code == 200:
bo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5749c3d690d86a2253783fae8fd2d93905466e1 | 1,672 | py | Python | photos/views.py | mosesbabu/photoshare | 18f2e72882fde6ce45482f9cf59af3ef41351585 | [
"MIT"
] | null | null | null | photos/views.py | mosesbabu/photoshare | 18f2e72882fde6ce45482f9cf59af3ef41351585 | [
"MIT"
] | 9 | 2021-03-19T03:53:39.000Z | 2022-03-12T00:32:01.000Z | photos/views.py | mosesbabu/photoshare | 18f2e72882fde6ce45482f9cf59af3ef41351585 | [
"MIT"
] | null | null | null |
# Create your views here.
| 40.780488 | 142 | 0.753589 | from .models import Image,Category,Location
from django.http import HttpResponse,Http404
from django.shortcuts import render
import datetime as dt
# Create your views here.
def photo_display(request):
all_images = Image.objects.all()
category_results = Category.objects.all()
location_results = Location.o... | 0 | 0 | 0 | 0 | 0 | 1,398 | 0 | 60 | 180 |
48b76621eeb8488a5da816a2d8f6237103b6d2e9 | 790 | py | Python | pysal/region/tests/test_components.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/region/tests/test_components.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/region/tests/test_components.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-07-19T01:46:17.000Z | 2021-07-19T01:46:17.000Z |
import unittest
suite = unittest.TestLoader().loadTestsFromTestCase(Test_Components)
if __name__ == '__main__':
runner = unittest.TextTestRunner()
runner.run(suite)
| 30.384615 | 74 | 0.656962 |
import unittest
import pysal
class Test_Components(unittest.TestCase):
def setUp(self):
self.w = pysal.lat2W(5, 5)
def test_check_contiguity(self):
result = pysal.region.check_contiguity(self.w, [0, 1, 2, 3, 4], 4)
self.assertEquals(result, True)
result = pysal.region.check_c... | 0 | 0 | 0 | 576 | 0 | 0 | 0 | -9 | 45 |
d29d6a0ed7362d3ae2be7f320e06b776a7e300a0 | 1,552 | py | Python | python/modular/run_explore.py | wildlava/explore | 8f7417607fc95919518d05dafac98802820c832c | [
"MIT"
] | 1 | 2021-08-24T15:29:23.000Z | 2021-08-24T15:29:23.000Z | python/modular/run_explore.py | wildlava/explore | 8f7417607fc95919518d05dafac98802820c832c | [
"MIT"
] | null | null | null | python/modular/run_explore.py | wildlava/explore | 8f7417607fc95919518d05dafac98802820c832c | [
"MIT"
] | null | null | null | #
# Explore
# - The Adventure Interpreter
#
# Copyright (C) 2006 Joe Peterson
#
import sys
import Explore
filename = None
no_delay = False
trs_compat = False
for arg_num in range(len(sys.argv)):
if sys.argv[arg_num] == "-f":
if len(sys.argv) > (arg_num + 1) and (len(sys.argv[arg_num + 1]) == 0 or sy... | 33.73913 | 114 | 0.561856 | #
# Explore
# - The Adventure Interpreter
#
# Copyright (C) 2006 Joe Peterson
#
import sys
import Explore
filename = None
no_delay = False
trs_compat = False
for arg_num in range(len(sys.argv)):
if sys.argv[arg_num] == "-f":
if len(sys.argv) > (arg_num + 1) and (len(sys.argv[arg_num + 1]) == 0 or sy... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ecb915fa82646c37afde3791a33d6f881187f1aa | 4,275 | py | Python | scripts/local_goal_creator.py | Jumpei-Arima/local_goal_creator | ec571fd76e43f3ceb889a1222a58a9ee11a86032 | [
"BSD-3-Clause"
] | null | null | null | scripts/local_goal_creator.py | Jumpei-Arima/local_goal_creator | ec571fd76e43f3ceb889a1222a58a9ee11a86032 | [
"BSD-3-Clause"
] | null | null | null | scripts/local_goal_creator.py | Jumpei-Arima/local_goal_creator | ec571fd76e43f3ceb889a1222a58a9ee11a86032 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import rospy
if __name__ == '__main__':
local_goal_creator = LocalGoalCreator()
try:
local_goal_creator.process()
except rospy.ROSInterruptException:
pass
| 39.953271 | 117 | 0.580585 | #!/usr/bin/python
import math
import json
import random
import rospy
from geometry_msgs.msg import PoseStamped
import tf2_ros
import tf2_geometry_msgs
from utils import *
class LocalGoalCreator:
def __init__(self):
rospy.init_node('LocalGoalCreator', anonymous=True)
# param
self.HZ = r... | 0 | 0 | 0 | 3,906 | 0 | 0 | 0 | -14 | 179 |
21055630c178f95cf6056a746fd7ba4eb3d576c8 | 166 | py | Python | 281A - Word Capitalization.py | bugraaldal/Codeforces | fc5bc0abd94ccf9244d0465e4173fa1ef463630a | [
"MIT"
] | 3 | 2021-04-30T09:25:33.000Z | 2021-04-30T09:25:57.000Z | 281A - Word Capitalization.py | bugraaldal/Codeforces | fc5bc0abd94ccf9244d0465e4173fa1ef463630a | [
"MIT"
] | null | null | null | 281A - Word Capitalization.py | bugraaldal/Codeforces | fc5bc0abd94ccf9244d0465e4173fa1ef463630a | [
"MIT"
] | null | null | null | # https://codeforces.com/problemset/problem/281/A
capital_Input = input("")
compare_List = list(capital_Input)
a = compare_List[0].upper()
print(a+capital_Input[1:])
| 27.666667 | 49 | 0.753012 | # https://codeforces.com/problemset/problem/281/A
capital_Input = input("")
compare_List = list(capital_Input)
a = compare_List[0].upper()
print(a+capital_Input[1:])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bc9592be551305633d2659ce4c7a6eb4592ea144 | 3,998 | py | Python | matador/workflows/castep/common.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | 24 | 2020-01-21T21:40:44.000Z | 2022-03-23T13:37:18.000Z | matador/workflows/castep/common.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | 234 | 2020-02-03T15:56:58.000Z | 2022-03-29T21:36:45.000Z | matador/workflows/castep/common.py | dquigley-warwick/matador | 729e97efb0865c4fff50af87555730ff4b7b6d91 | [
"MIT"
] | 15 | 2019-11-29T11:33:32.000Z | 2021-11-02T09:14:08.000Z | # coding: utf-8
# Distributed under the terms of the MIT License.
""" This submodule implements some common workflow steps for use in
more complicated workflows.
"""
import copy
import logging
__all__ = ("castep_prerelax", "castep_scf")
LOG = logging.getLogger("run3")
def castep_scf(
computer,
calc_doc,
... | 31.984 | 102 | 0.668084 | # coding: utf-8
# Distributed under the terms of the MIT License.
""" This submodule implements some common workflow steps for use in
more complicated workflows.
"""
import copy
import logging
__all__ = ("castep_prerelax", "castep_scf")
LOG = logging.getLogger("run3")
def castep_scf(
computer,
calc_doc,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d99c589bbdadb62e8e0c267353bf02875e75ea2b | 465 | py | Python | Menu.py | PatrickLenis/FLAT_Project_2020 | d3bfe17504e58c63c6b094d72cb33721da8a8e8d | [
"MIT"
] | null | null | null | Menu.py | PatrickLenis/FLAT_Project_2020 | d3bfe17504e58c63c6b094d72cb33721da8a8e8d | [
"MIT"
] | null | null | null | Menu.py | PatrickLenis/FLAT_Project_2020 | d3bfe17504e58c63c6b094d72cb33721da8a8e8d | [
"MIT"
] | null | null | null |
#inp = "(01*1)*1"
print("\nProject 5 : Construction of an Dfa equivalent to a Regular Expression\nBy Patrick Lenis & Paul Cvasa")
print("Regular expression examples : xy, x+y, x*, (xy*y)*y\n")
inp = input("Your regular expression : ")
nfaObj = NFAfromRegex(inp)
nfa = nfaObj.getNFA()
print ("\nNFA: ")
nfaOb... | 23.25 | 112 | 0.655914 | from Regex_To_Dfa import *
#inp = "(01*1)*1"
print("\nProject 5 : Construction of an Dfa equivalent to a Regular Expression\nBy Patrick Lenis & Paul Cvasa")
print("Regular expression examples : xy, x+y, x*, (xy*y)*y\n")
inp = input("Your regular expression : ")
nfaObj = NFAfromRegex(inp)
nfa = nfaObj.getNFA()... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 23 |
528d4a298d2d083011092bf7af07a34511bf17c0 | 564 | py | Python | Python3/Python3_Lesson03/src/testgen.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | Python3/Python3_Lesson03/src/testgen.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | Python3/Python3_Lesson03/src/testgen.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | """
testgen.py: simple test for a sequence generator
"""
import unittest
#from gen123 import gen123
if __name__ == "__main__":
unittest.main() | 29.684211 | 85 | 0.613475 | """
testgen.py: simple test for a sequence generator
"""
import unittest
#from gen123 import gen123
from class123 import gen123
class TestGen(unittest.TestCase):
def testEmpty(self):
self.assertEqual(list(gen123([])), [], "Empty list does not give empty list")
def test123(self):
self.... | 0 | 0 | 0 | 357 | 0 | 0 | 0 | 6 | 45 |
b8bea2f44392cbfc3a21409ead035541b62a814e | 4,774 | py | Python | UpWork_Projects/Will Farell_Spiders/boroondara/boroondara/spiders/boroondara_spider.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | null | null | null | UpWork_Projects/Will Farell_Spiders/boroondara/boroondara/spiders/boroondara_spider.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | null | null | null | UpWork_Projects/Will Farell_Spiders/boroondara/boroondara/spiders/boroondara_spider.py | SurendraTamang/Web-Scrapping | 2bb60cce9010b4b68f5c11bf295940832bb5df50 | [
"MIT"
] | 1 | 2022-01-18T17:15:51.000Z | 2022-01-18T17:15:51.000Z | # -*- coding: utf-8 -*- | 46.803922 | 177 | 0.559698 | # -*- coding: utf-8 -*-
import scrapy
from scrapy.selector import Selector
from scrapy_selenium import SeleniumRequest
from selenium.webdriver.common.keys import Keys
import time
import datetime
class BoroondaraSpiderSpider(scrapy.Spider):
name = 'boroondara_spider'
def remove_nonUTF_char(self, value):
... | 0 | 0 | 0 | 4,557 | 0 | 0 | 0 | 39 | 155 |
c79fc0f1c6ab723440f80bb33d61a345e05c905e | 18,274 | py | Python | xfel/merging/algorithms/error_model/sdfac_propagate.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | xfel/merging/algorithms/error_model/sdfac_propagate.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | xfel/merging/algorithms/error_model/sdfac_propagate.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
"""
Classes to support propagating erros after postrefinement in cxi.merge
"""
# Bucket to hold refinable error terms
| 46.498728 | 156 | 0.608022 | from __future__ import division
from six.moves import range
from dials.array_family import flex
import math
from rstbx.symmetry.constraints.parameter_reduction \
import symmetrize_reduce_enlarge
from scitbx.matrix import sqr, col
from xfel.merging.algorithms.error_model.error_modeler_base import error_modeler_base... | 0 | 235 | 0 | 17,389 | 0 | 25 | 0 | 227 | 246 |
b87e8dd6617529d84fccb1b202f8596500d76e96 | 6,198 | py | Python | benchmarks/basic_operations.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 832 | 2017-01-03T06:21:31.000Z | 2022-03-16T16:51:44.000Z | benchmarks/basic_operations.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 139 | 2017-02-16T16:02:48.000Z | 2022-02-10T14:05:41.000Z | benchmarks/basic_operations.py | eoghanmurray/aredis | e0ddfea1c6e21219aca9f67b10160bc380540fbf | [
"MIT"
] | 116 | 2017-01-05T06:33:50.000Z | 2022-03-06T05:02:47.000Z | import asyncio
import uvloop
import sys
if sys.version_info[0] == 3:
long = int
if __name__ == '__main__':
print('WITH ASYNCIO ONLY:')
loop = asyncio.get_event_loop()
loop.run_until_complete(run())
print('WITH UVLOOP:')
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
lo... | 28.562212 | 80 | 0.593901 | import aredis
import asyncio
import uvloop
import time
import sys
from functools import wraps
from argparse import ArgumentParser
if sys.version_info[0] == 3:
long = int
def parse_args():
parser = ArgumentParser()
parser.add_argument('-n',
type=int,
help='T... | 0 | 3,975 | 766 | 0 | 0 | 706 | 0 | 2 | 364 |
eb0b74a23ba9cd178be55cbe7800dbb08aa10f17 | 803 | py | Python | catlas/load_adsorbate_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | null | null | null | catlas/load_adsorbate_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | 34 | 2021-12-02T16:55:34.000Z | 2022-03-30T17:58:35.000Z | catlas/load_adsorbate_structures.py | ulissigroup/catlas | 1796bf562f21f4afaee8999bbdf0ed76e63f8501 | [
"MIT"
] | 1 | 2021-12-14T17:22:19.000Z | 2021-12-14T17:22:19.000Z | import os.path
dir_path = os.path.dirname(os.path.realpath(__file__))
| 27.689655 | 66 | 0.571606 | import pickle
import os.path
import catlas
dir_path = os.path.dirname(os.path.realpath(__file__))
def load_ocdata_adsorbates(adsorbate_path):
path = "%s/%s" % (
os.path.join(os.path.dirname(catlas.__file__), os.pardir),
adsorbate_path,
)
with open(path, "rb") as fhandle:
adsorbate... | 0 | 0 | 0 | 0 | 0 | 680 | 0 | -16 | 67 |
6a337e5753d90a32fcc95c5143f7f713c30e8f40 | 3,826 | py | Python | configs/MJOD_Net/MJOD_Net_ratio_1234_coco_mahjong_lr_0.02_batch_8_epoch_24.py | jaheel/MJOD-2136 | 81d4b8b79316f010279ef2c13a30827ae6b25c87 | [
"Apache-2.0"
] | null | null | null | configs/MJOD_Net/MJOD_Net_ratio_1234_coco_mahjong_lr_0.02_batch_8_epoch_24.py | jaheel/MJOD-2136 | 81d4b8b79316f010279ef2c13a30827ae6b25c87 | [
"Apache-2.0"
] | null | null | null | configs/MJOD_Net/MJOD_Net_ratio_1234_coco_mahjong_lr_0.02_batch_8_epoch_24.py | jaheel/MJOD-2136 | 81d4b8b79316f010279ef2c13a30827ae6b25c87 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
type='MJODNet',
pretrained='open-mmlab://regnetx_400mf',
backbone=dict(
type='RegNet',
arch='regnetx_400mf',
out_indices=(3, ),
frozen_stages=1,
norm_cfg=dict(type='BN'... | 31.105691 | 77 | 0.600105 | _base_ = [
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
model = dict(
type='MJODNet',
pretrained='open-mmlab://regnetx_400mf',
backbone=dict(
type='RegNet',
arch='regnetx_400mf',
out_indices=(3, ),
frozen_stages=1,
norm_cfg=dict(type='BN'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
751b58840a5019ee0b41172f71612a05dc0c3c49 | 160 | py | Python | Python/django_viewsets_studies/App/Article/admin.py | wendrewdevelop/Estudos | f75d62574a0455ff35b97d404329e43f12f419fb | [
"MIT"
] | null | null | null | Python/django_viewsets_studies/App/Article/admin.py | wendrewdevelop/Estudos | f75d62574a0455ff35b97d404329e43f12f419fb | [
"MIT"
] | null | null | null | Python/django_viewsets_studies/App/Article/admin.py | wendrewdevelop/Estudos | f75d62574a0455ff35b97d404329e43f12f419fb | [
"MIT"
] | null | null | null | # django imports
from django.contrib import admin
# app imports
from .models import Article, Author
admin.site.register(Article)
admin.site.register(Author)
| 16 | 35 | 0.79375 | # django imports
from django.contrib import admin
# app imports
from .models import Article, Author
admin.site.register(Article)
admin.site.register(Author)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
adb98cd5f300d6d0e08eba6bf62faca8a7b92ea3 | 16,099 | py | Python | module/HME.py | wjn1996/PCNN_RL_HME | 2f5e5a357706c236b0cd89f193cd49b1c2c3fe8a | [
"Apache-2.0"
] | 3 | 2021-02-19T12:05:06.000Z | 2021-06-08T14:33:57.000Z | module/HME.py | wjn1996/PCNN_RL_HME | 2f5e5a357706c236b0cd89f193cd49b1c2c3fe8a | [
"Apache-2.0"
] | null | null | null | module/HME.py | wjn1996/PCNN_RL_HME | 2f5e5a357706c236b0cd89f193cd49b1c2c3fe8a | [
"Apache-2.0"
] | 1 | 2022-03-15T14:53:35.000Z | 2022-03-15T14:53:35.000Z | import torch.nn as nn
import torch.optim as optim
# from configure import args
# Hierarchical Memory Extractor
| 53.842809 | 129 | 0.533077 | import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import random
# from configure import args
from load_data import find_node
# Hierarchical Memory Extractor 分层记忆抽取器
class HME(nn.Module):
'''
分层记忆抽取器... | 1,938 | 0 | 0 | 15,162 | 0 | 0 | 0 | 14 | 160 |
894ebf40707576125fc0b771171e8d1326b8e918 | 583 | py | Python | src/src.py | Overexm/python_assignment2 | e8b2c8b2e75e0eff82a6e240a4ad6e4e0c3463f0 | [
"MIT"
] | null | null | null | src/src.py | Overexm/python_assignment2 | e8b2c8b2e75e0eff82a6e240a4ad6e4e0c3463f0 | [
"MIT"
] | null | null | null | src/src.py | Overexm/python_assignment2 | e8b2c8b2e75e0eff82a6e240a4ad6e4e0c3463f0 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from urllib.request import urlopen
url = "https://coinmarketcap.com"
html = urlopen(url)
soup = BeautifulSoup(html, 'lxml')
| 24.291667 | 54 | 0.643225 | from bs4 import BeautifulSoup
from urllib.request import urlopen
url = "https://coinmarketcap.com"
html = urlopen(url)
soup = BeautifulSoup(html, 'lxml')
class WebScrapper:
def getDateByRequest(currencyName):
some_list = []
for paragraph in soup.find_all("p"):
if currencyName in par... | 0 | 0 | 0 | 404 | 0 | 0 | 0 | 0 | 23 |
28349e092ed9c13d1c7e3c85aec9dd8f89e5bf12 | 2,179 | py | Python | assets/2019-06-10/train.py | vruusmann/blog | 9f63a0361686f9e20a5a038cb67769df80405573 | [
"MIT"
] | null | null | null | assets/2019-06-10/train.py | vruusmann/blog | 9f63a0361686f9e20a5a038cb67769df80405573 | [
"MIT"
] | null | null | null | assets/2019-06-10/train.py | vruusmann/blog | 9f63a0361686f9e20a5a038cb67769df80405573 | [
"MIT"
] | 2 | 2019-02-19T07:59:45.000Z | 2019-12-10T13:56:16.000Z | from sklearn_pandas import DataFrameMapper
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import LabelBinarizer
from sklearn2pmml.decoration import Alias, CategoricalDomain, ContinuousDomain
from sklearn2pmml.preprocessing import ExpressionTransformer
import pandas
df = pandas.read_csv("audit.csv")
... | 36.316667 | 153 | 0.785223 | from sklearn_pandas import DataFrameMapper
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import LabelBinarizer
from sklearn2pmml.decoration import Alias, CategoricalDomain, ContinuousDomain
from sklearn2pmml.preprocessing import ExpressionTransformer
import pandas
df = pandas.read_csv("audit.csv")
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c82d0a4815a4179b30f3cbc61529e10f16c8e702 | 3,223 | py | Python | action/action.py | lluminov/Yeagle | 241c8d3a6f3679c1a4033a20934d46be7b6cae95 | [
"MIT"
] | 1 | 2021-01-09T09:15:00.000Z | 2021-01-09T09:15:00.000Z | action/action.py | lluminov/Yeagle | 241c8d3a6f3679c1a4033a20934d46be7b6cae95 | [
"MIT"
] | null | null | null | action/action.py | lluminov/Yeagle | 241c8d3a6f3679c1a4033a20934d46be7b6cae95 | [
"MIT"
] | null | null | null | import sys
import subprocess
import pandas as pd
import os
from pathlib import Path
import datetime
import ast
from configparser import ConfigParser
'''Reading the Config file from command line argument'''
parser = ConfigParser()
pd.set_option('display.max_columns', None)
config_file = sys.argv[1]
parser.read(config_... | 45.394366 | 114 | 0.608439 | import sys
import subprocess
import pandas as pd
import os
from pathlib import Path
import time
import datetime
import ast
from configparser import ConfigParser
'''Reading the Config file from command line argument'''
parser = ConfigParser()
pd.set_option('display.max_columns', None)
config_file = sys.argv[1]
parser.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
4859d0104affa4b6dd6b0fce96b9ba9b9e823508 | 1,406 | py | Python | pymodbus/framer/__init__.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 1,125 | 2017-05-11T06:11:36.000Z | 2022-03-31T02:59:45.000Z | pymodbus/framer/__init__.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 575 | 2017-05-12T02:46:55.000Z | 2022-03-31T16:00:33.000Z | pymodbus/framer/__init__.py | vmacari/pymodbus | ec97e2f2b50c6db0a932f44e550a5dee60bf0970 | [
"BSD-3-Clause"
] | 516 | 2017-05-19T14:06:06.000Z | 2022-03-31T06:10:13.000Z |
# Unit ID, Function Code
BYTE_ORDER = '>'
FRAME_HEADER = 'BB'
# Transaction Id, Protocol ID, Length, Unit ID, Function Code
SOCKET_FRAME_HEADER = BYTE_ORDER + 'HHH' + FRAME_HEADER
# Function Code
TLS_FRAME_HEADER = BYTE_ORDER + 'B'
| 28.12 | 72 | 0.610242 | from pymodbus.interfaces import IModbusFramer
import struct
# Unit ID, Function Code
BYTE_ORDER = '>'
FRAME_HEADER = 'BB'
# Transaction Id, Protocol ID, Length, Unit ID, Function Code
SOCKET_FRAME_HEADER = BYTE_ORDER + 'HHH' + FRAME_HEADER
# Function Code
TLS_FRAME_HEADER = BYTE_ORDER + 'B'
class ModbusFramer(IModb... | 0 | 0 | 0 | 1,088 | 0 | 0 | 0 | 16 | 67 |
e92abe42ccb3a2963e233950827b0d1fe8240626 | 10,418 | py | Python | minghu6/tools/tieba.py | minghu6/py-minghu6 | 312bff9c66a0ba936f8600ba019fc514337e92ec | [
"BSD-3-Clause"
] | 2 | 2016-08-23T09:37:34.000Z | 2020-07-05T09:30:57.000Z | minghu6/tools/tieba.py | minghu6/minghu6_py | 2874e3302c8910960a3a8cbc874ab32d22d7edaa | [
"BSD-3-Clause"
] | null | null | null | minghu6/tools/tieba.py | minghu6/minghu6_py | 2874e3302c8910960a3a8cbc874ab32d22d7edaa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding:utf-8 -*-
# !/usr/bin/env python3
"""
download tie from Baidu Tieba
"""
import urllib.error
import urllib.parse
#
#
if __name__ == '__main__':
cli()
| 32.154321 | 91 | 0.515358 | # -*- coding:utf-8 -*-
# !/usr/bin/env python3
"""
download tie from Baidu Tieba
"""
import http.client
import os
import re
import urllib.error
import urllib.parse
import urllib.request
from minghu6.http.request import headers
from color import color
from minghu6.text.encoding import get_decode_html
... | 1,128 | 1,173 | 0 | 6,777 | 0 | 1,615 | 0 | 22 | 260 |
73b95f29f8a3ca04489a36bc3742abbcca2ac112 | 12,712 | py | Python | src/kodi_addon_dev/displays.py | alexhulbert/kodi-addondev | 5fac65822a51c5691645fd638c51303b66189500 | [
"MIT"
] | null | null | null | src/kodi_addon_dev/displays.py | alexhulbert/kodi-addondev | 5fac65822a51c5691645fd638c51303b66189500 | [
"MIT"
] | null | null | null | src/kodi_addon_dev/displays.py | alexhulbert/kodi-addondev | 5fac65822a51c5691645fd638c51303b66189500 | [
"MIT"
] | null | null | null | from __future__ import print_function
# Standard Library Imports
from typing import NamedTuple
# Package imports
try:
from shutil import get_terminal_size
except ImportError:
# noinspection PyUnresolvedReferences
# The Processed Listitem Named tuple, Make listitems easier to work with
Listitem = NamedTuple(... | 38.874618 | 118 | 0.578823 | from __future__ import print_function
# Standard Library Imports
from typing import List, Iterator, NamedTuple, NoReturn
from functools import partial
from copy import deepcopy
import binascii
import argparse
import pickle
import json
import abc
import re
# Package imports
from kodi_addon_dev.repo import LocalRepo
fr... | 0 | 4,202 | 0 | 7,611 | 0 | 0 | 0 | 112 | 336 |
b5906a43a8e3da3896eb3f51d3b86389ac06ab65 | 13,587 | py | Python | tests/resource_tests/schema_tests/test_resource_schemas.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 39 | 2017-10-13T19:16:27.000Z | 2021-09-24T16:58:21.000Z | tests/resource_tests/schema_tests/test_resource_schemas.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | tests/resource_tests/schema_tests/test_resource_schemas.py | all-of-us/raw-data-repository | d28ad957557587b03ff9c63d55dd55e0508f91d8 | [
"BSD-3-Clause"
] | 19 | 2017-09-15T13:58:00.000Z | 2022-02-07T18:33:20.000Z | #
# This file is subject to the terms and conditions defined in the
# file 'LICENSE', which is part of this source code package.
#
# -- BQ model imports
from rdr_service.resource import schemas as rschemas
# Common fields from all the BQ schemas which should be excluded from comparison. If the resource schema conta... | 51.661597 | 120 | 0.65099 | #
# This file is subject to the terms and conditions defined in the
# file 'LICENSE', which is part of this source code package.
#
import json
import unittest
from tests.helpers.unittest_base import BaseTestCase
# -- BQ model imports
from rdr_service.model import (
bq_code, bq_genomics, bq_hpo, bq_organization, b... | 0 | 1,605 | 0 | 9,561 | 0 | 0 | 0 | 266 | 112 |
e3236fb3b0c13ec2493a871001e35524096ad1ca | 86 | py | Python | src/python/baekjoon/8393.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | src/python/baekjoon/8393.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | src/python/baekjoon/8393.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | n = int(input())
result = 0
for num in range(1, n+1) :
result += num
print(result) | 17.2 | 26 | 0.604651 | n = int(input())
result = 0
for num in range(1, n+1) :
result += num
print(result) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
957367cc6c57a6b0b9c3863071247dd9f9e0ecf0 | 5,021 | py | Python | nox/src/nox/coreapps/messenger/messenger.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 28 | 2015-02-04T13:59:25.000Z | 2021-12-29T03:44:47.000Z | nox/src/nox/coreapps/messenger/messenger.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 552 | 2015-01-05T18:25:54.000Z | 2022-03-16T18:51:13.000Z | nox/src/nox/coreapps/messenger/messenger.py | ayjazz/OESS | deadc504d287febc7cbd7251ddb102bb5c8b1f04 | [
"Apache-2.0"
] | 25 | 2015-02-04T18:48:20.000Z | 2020-06-18T15:51:05.000Z | import struct
import socket
import select
## This module provides library to send and receive messages to NOX's messenger
#
# This is a rewrite of noxmsg.py from OpenRoads (OpenFlow Wireless)
#
# @author ykk (Stanford University)
# @date January, 2010
# @see messenger
def stringarray(string):
"""Output array of ... | 27.740331 | 133 | 0.599084 | import struct
import socket
import select
## This module provides library to send and receive messages to NOX's messenger
#
# This is a rewrite of noxmsg.py from OpenRoads (OpenFlow Wireless)
#
# @author ykk (Stanford University)
# @date January, 2010
# @see messenger
def stringarray(string):
"""Output array of ... | 0 | 0 | 0 | 3,982 | 0 | 0 | 0 | 0 | 69 |
ae11cb0519d0b4966d63b98d0b134ffb04e4a5e9 | 6,840 | py | Python | tools/fetching.py | Simpleyyt/android-remote-control | fcd494d7195478d115aadd6ff90431f7641ae1d8 | [
"MIT"
] | null | null | null | tools/fetching.py | Simpleyyt/android-remote-control | fcd494d7195478d115aadd6ff90431f7641ae1d8 | [
"MIT"
] | null | null | null | tools/fetching.py | Simpleyyt/android-remote-control | fcd494d7195478d115aadd6ff90431f7641ae1d8 | [
"MIT"
] | 1 | 2021-09-26T08:27:57.000Z | 2021-09-26T08:27:57.000Z | import os
import zipfile
from logzero import logger
from adbutils import device as get_device
device = get_device()
atx_agent_version = "0.10.0"
__all__ = ["get_atx_agent_bundle", "get_whatsinput_apk"]
def get_atx_agent_bundle() -> str:
"""
bundle all platform atx-agent binary into one zip file
"""
... | 32.264151 | 114 | 0.619152 | import os
import shutil
import tarfile
import tempfile
import zipfile
import traceback
import requests
import apkutils2
from logzero import logger
from adbutils import device as get_device
device = get_device()
atx_agent_version = "0.10.0"
__all__ = ["get_atx_agent_bundle", "get_whatsinput_apk"]
def get_atx_agent_b... | 0 | 0 | 0 | 0 | 0 | 5,025 | 0 | -37 | 316 |
f2d2234fe7754e44636c2d0cf7e6409371025ccc | 677 | py | Python | HW5/tests/q1.3.py | ds-modules/EPS-130-SP21 | 783f244145877ad97c0eafde26024310adab55f5 | [
"BSD-3-Clause"
] | 1 | 2021-01-21T17:00:16.000Z | 2021-01-21T17:00:16.000Z | HW5/tests/q1.3.py | ds-modules/EPS-130-SP21 | 783f244145877ad97c0eafde26024310adab55f5 | [
"BSD-3-Clause"
] | null | null | null | HW5/tests/q1.3.py | ds-modules/EPS-130-SP21 | 783f244145877ad97c0eafde26024310adab55f5 | [
"BSD-3-Clause"
] | null | null | null | test = { 'name': 'q1.3',
'points': 1,
'suites': [ { 'cases': [ { 'code': '>>> assert np.abs(v_direct_forward - 1280) / 1280 < 0.1;\n'
'>>> assert v_head_forward > 7000;\n'
'>>> assert v_direct_reverse < 2000;... | 52.076923 | 107 | 0.301329 | test = { 'name': 'q1.3',
'points': 1,
'suites': [ { 'cases': [ { 'code': '>>> assert np.abs(v_direct_forward - 1280) / 1280 < 0.1;\n'
'>>> assert v_head_forward > 7000;\n'
'>>> assert v_direct_reverse < 2000;... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6aa54382a3179047c6cd77d0bc59b52dcb2f12f4 | 1,580 | py | Python | python/cac_tripplanner/cms/migrations/0007_add_defalut_aboutfaq.py | azavea/cac-tripplanner | 08eaa7e909484ac04687e078fbecba7e7fdc452e | [
"Apache-2.0"
] | 13 | 2015-08-07T13:54:53.000Z | 2020-10-20T18:59:01.000Z | python/cac_tripplanner/cms/migrations/0007_add_defalut_aboutfaq.py | azavea/cac-tripplanner | 08eaa7e909484ac04687e078fbecba7e7fdc452e | [
"Apache-2.0"
] | 1,177 | 2015-01-15T16:46:38.000Z | 2022-03-29T13:37:37.000Z | python/cac_tripplanner/cms/migrations/0007_add_defalut_aboutfaq.py | azavea/cac-tripplanner | 08eaa7e909484ac04687e078fbecba7e7fdc452e | [
"Apache-2.0"
] | 7 | 2015-01-19T20:10:38.000Z | 2019-10-16T05:57:47.000Z | # -*- coding: utf-8 -*-
from django.utils import timezone
ABOUT_PAGE = {
'title': 'About',
'slug': 'about',
'content': 'About placeholder text',
'publish_date': timezone.now(),
'created': timezone.now(),
'modified': timezone.now()
}
FAQ_PAGE = {
'title': 'Frequently Asked Questions',
... | 25.483871 | 89 | 0.644304 | # -*- coding: utf-8 -*-
from django.db import models, migrations
from django.utils import timezone
ABOUT_PAGE = {
'title': 'About',
'slug': 'about',
'content': 'About placeholder text',
'publish_date': timezone.now(),
'created': timezone.now(),
'modified': timezone.now()
}
FAQ_PAGE = {
... | 0 | 0 | 0 | 168 | 0 | 823 | 0 | 19 | 92 |
60912f18e02dc625a2a44a7086faff546579aa6a | 3,047 | bzl | Python | scripts/packages/self_extract_binary.bzl | NunoEdgarGFlowHub/heron | 53380553d79a9473184821e5864aedfe9f45f290 | [
"Apache-2.0"
] | 2 | 2016-07-04T07:10:31.000Z | 2018-03-28T16:59:02.000Z | scripts/packages/self_extract_binary.bzl | NunoEdgarGFlowHub/heron | 53380553d79a9473184821e5864aedfe9f45f290 | [
"Apache-2.0"
] | null | null | null | scripts/packages/self_extract_binary.bzl | NunoEdgarGFlowHub/heron | 53380553d79a9473184821e5864aedfe9f45f290 | [
"Apache-2.0"
] | 1 | 2019-10-02T15:23:46.000Z | 2019-10-02T15:23:46.000Z | # Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 34.235955 | 80 | 0.612406 | # Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bd6e1b9da2cb0eea86357ed3b16b36c92b60979d | 12,986 | py | Python | radlib.py | lytboris/py-radlib | a4309aa99a0bd76fe6bed80612ee04e94b52504d | [
"BSD-2-Clause"
] | null | null | null | radlib.py | lytboris/py-radlib | a4309aa99a0bd76fe6bed80612ee04e94b52504d | [
"BSD-2-Clause"
] | null | null | null | radlib.py | lytboris/py-radlib | a4309aa99a0bd76fe6bed80612ee04e94b52504d | [
"BSD-2-Clause"
] | null | null | null | #!/usr/local/bin/python3
'''
libradius(3) wrapper
'''
from ctypes import util
from collections import namedtuple
RadiusAttribute = namedtuple('RadiusAttribute', ['type', 'data', 'datalen', 'vendor'])
radlib = CDLL(util.find_library("radius"))
libc = CDLL(util.find_library("c"))
libc.free.argtypes = [c_void_p]
rad... | 31.596107 | 108 | 0.710996 | #!/usr/local/bin/python3
'''
libradius(3) wrapper
'''
import socket
from ctypes import *
from ctypes import util
from collections import namedtuple
from enum import IntEnum, unique
RadiusAttribute = namedtuple('RadiusAttribute', ['type', 'data', 'datalen', 'vendor'])
class DirctionaryChapter(IntEnum):
# allow u... | 0 | 4,139 | 0 | 169 | 0 | 4,660 | 0 | 2 | 1,114 |
5fe877d42d61f76473078fa08aa8d5d1071c92eb | 513 | py | Python | run.py | j-sripad/knn-shapley-pytorch | 4b30ce18cf6d692628331ee93dc42f48cf74d826 | [
"MIT"
] | null | null | null | run.py | j-sripad/knn-shapley-pytorch | 4b30ce18cf6d692628331ee93dc42f48cf74d826 | [
"MIT"
] | null | null | null | run.py | j-sripad/knn-shapley-pytorch | 4b30ce18cf6d692628331ee93dc42f48cf74d826 | [
"MIT"
] | 1 | 2022-03-27T06:29:45.000Z | 2022-03-27T06:29:45.000Z | import torch
if __name__ == "__main__":
save_dir = "fmnist_shapley.pt"
scores = main()
print(scores)
torch.save(scores, save_dir) | 20.52 | 48 | 0.695906 | import torch
from models.resnet import ResNet
from shapley.dshap import DShap
from utils.dataset import FashionMNISTDataModule
from shapley.knn_shapley import KNNShapley
def main():
dm = FashionMNISTDataModule()
dm.setup()
model = ResNet()
measure = KNNShapley()
dshap = DShap(dm, model, m... | 0 | 0 | 0 | 0 | 0 | 182 | 0 | 69 | 114 |
f2a3599f72d06256b2f1a0140f413e67c773e9fd | 1,164 | py | Python | tests/test_representations.py | childsish/dynamic-yaml | a7186d7f9b18f3dc0859c18fcb2b9ed5655e9fba | [
"MIT"
] | 27 | 2017-04-04T18:46:02.000Z | 2022-01-14T16:09:52.000Z | tests/test_representations.py | childsish/dynamic-pyyaml | ea50d792120e87d1f2ad496364512d9591daacc0 | [
"MIT"
] | 10 | 2019-05-03T14:52:11.000Z | 2021-11-11T10:49:37.000Z | tests/test_representations.py | childsish/dynamic-pyyaml | ea50d792120e87d1f2ad496364512d9591daacc0 | [
"MIT"
] | 8 | 2018-08-01T09:27:08.000Z | 2022-01-06T06:10:50.000Z |
from unittest import main
if __name__ == '__main__':
import sys
sys.exit(main())
| 27.714286 | 140 | 0.597938 | import yaml
from unittest import TestCase, main
from dynamic_yaml import load, dump
class TestDynamicYaml(TestCase):
def test_json_dump(self):
config = '''
project_name: hello-world
dirs:
home_dir: /home/user
project_dir: "{dirs.home_dir}/projects/{project_name}"
... | 0 | 0 | 0 | 988 | 0 | 0 | 0 | 14 | 68 |
8b75e95ceb769f14cacbd3114c2511812cc53a32 | 411 | py | Python | Backend/Notizen/main.py | homer65/fellowcoder | 89433e1d44db64d9aa64a8603a7a38bcd220f035 | [
"Apache-2.0"
] | null | null | null | Backend/Notizen/main.py | homer65/fellowcoder | 89433e1d44db64d9aa64a8603a7a38bcd220f035 | [
"Apache-2.0"
] | null | null | null | Backend/Notizen/main.py | homer65/fellowcoder | 89433e1d44db64d9aa64a8603a7a38bcd220f035 | [
"Apache-2.0"
] | null | null | null | from flask_cors import CORS
if __name__ == "__main__":
app = Flask(__name__)
app.secret_key = "averysecretkey" # secret key for encoding and decoding session data
#app.permanent_session_lifetime = datetime.timedelta(hours=12)
CORS(app, supports_credentials=True)
app.run() # for development
#... | 31.615385 | 95 | 0.715328 | from flask_cors import CORS
if __name__ == "__main__":
app = Flask(__name__)
app.secret_key = "averysecretkey" # secret key for encoding and decoding session data
#app.permanent_session_lifetime = datetime.timedelta(hours=12)
CORS(app, supports_credentials=True)
app.run() # for development
#... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac316c71d502bb78fb54a5328b095739323b6496 | 1,184 | py | Python | settings.py | YourKalamity/TWLHelper | 5dcd40783f61a086bcd09e04e6c7edcb5e5589a0 | [
"0BSD"
] | 6 | 2021-08-05T09:40:10.000Z | 2022-03-12T16:06:41.000Z | settings.py | YourKalamity/TWLHelper | 5dcd40783f61a086bcd09e04e6c7edcb5e5589a0 | [
"0BSD"
] | 16 | 2021-08-08T07:40:36.000Z | 2022-03-23T21:55:03.000Z | settings.py | YourKalamity/TWLHelper | 5dcd40783f61a086bcd09e04e6c7edcb5e5589a0 | [
"0BSD"
] | 8 | 2021-08-08T07:19:50.000Z | 2022-03-23T21:21:34.000Z | #
# ISC License
#
# Copyright (C) 2021-present DS-Homebrew
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND TH... | 34.823529 | 74 | 0.754223 | #
# ISC License
#
# Copyright (C) 2021-present DS-Homebrew
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND TH... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58e49225139fc1e6244a1c861514c4933a415ee4 | 1,044 | py | Python | setup.py | c3sr/-semantic-capacity | 2889475d445f31c180d7ec0149cb785d256e8f10 | [
"Apache-2.0"
] | 7 | 2020-10-17T19:50:20.000Z | 2021-12-09T19:42:44.000Z | setup.py | c3sr/-semantic-capacity | 2889475d445f31c180d7ec0149cb785d256e8f10 | [
"Apache-2.0"
] | null | null | null | setup.py | c3sr/-semantic-capacity | 2889475d445f31c180d7ec0149cb785d256e8f10 | [
"Apache-2.0"
] | 2 | 2020-10-05T03:58:58.000Z | 2020-10-05T04:41:09.000Z | # Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
from distutils.core import setup
from Cython.B... | 27.473684 | 82 | 0.72318 | # Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
from distutils.core import setup
from Cython.B... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b7240e542bf2fc16c1041249618333e1db779b74 | 9,579 | py | Python | test_api.py | eoliveros/zapm_server | c268690b4b0e7749307965fccbdbbe673d8fc9dd | [
"MIT"
] | null | null | null | test_api.py | eoliveros/zapm_server | c268690b4b0e7749307965fccbdbbe673d8fc9dd | [
"MIT"
] | null | null | null | test_api.py | eoliveros/zapm_server | c268690b4b0e7749307965fccbdbbe673d8fc9dd | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
URL_BASE = "http://localhost:5000/"
WS_URL = "ws://localhost:5000/"
EXIT_NO_COMMAND = 1
if __name__ == "__main__":
# parse arguments
parser = construct_parser()
args = parser.parse_args()
# set appropriate function
function = None
if args.command == "websocket"... | 40.079498 | 146 | 0.694749 | #!/usr/bin/python3
import sys
import argparse
import time
import json
import requests
import socketio
from utils import create_hmac_sig
URL_BASE = "http://localhost:5000/"
WS_URL = "ws://localhost:5000/"
EXIT_NO_COMMAND = 1
def construct_parser():
# construct argument parser
parser = argparse.ArgumentPars... | 0 | 293 | 0 | 0 | 0 | 7,730 | 0 | -26 | 456 |
04eba925c64e321c6c3fae9075e69e40a3773fdf | 9,023 | py | Python | orange3/Orange/widgets/evaluate/owliftcurve.py | rgschmitz1/BioDepot-workflow-builder | f74d904eeaf91ec52ec9b703d9fb38e9064e5a66 | [
"MIT"
] | 54 | 2017-01-08T17:21:49.000Z | 2021-11-02T08:46:07.000Z | orange3/Orange/widgets/evaluate/owliftcurve.py | Synthia-3/BioDepot-workflow-builder | 4ee93abe2d79465755e82a145af3b6a6e1e79fd4 | [
"MIT"
] | 22 | 2017-03-28T06:03:14.000Z | 2021-07-28T05:43:55.000Z | orange3/Orange/widgets/evaluate/owliftcurve.py | Synthia-3/BioDepot-workflow-builder | 4ee93abe2d79465755e82a145af3b6a6e1e79fd4 | [
"MIT"
] | 21 | 2017-01-26T21:12:09.000Z | 2022-01-31T21:34:59.000Z | """
Lift Curve Widget
-----------------
"""
from collections import namedtuple
CurvePoints = namedtuple("CurvePoints", ["cases", "tpr", "thresholds"])
CurvePoints.is_valid = property(lambda self: self.cases.size > 0)
LiftCurve = namedtuple("LiftCurve", ["points", "hull"])
LiftCurve.is_valid = property(lambda self: ... | 29.778878 | 83 | 0.614097 | """
Lift Curve Widget
-----------------
"""
from collections import namedtuple
import numpy as np
import sklearn.metrics as skl_metrics
from AnyQt import QtWidgets
from AnyQt.QtGui import QColor, QPen, QPalette, QFont
from AnyQt.QtCore import Qt
import pyqtgraph as pg
import Orange
from Orange.widgets import widge... | 0 | 283 | 0 | 6,004 | 0 | 1,641 | 0 | 227 | 405 |
db009fe43c223aa697ddfe7892d612aeb305a575 | 6,477 | py | Python | release/scripts/startup/bl_ui/space_time.py | wycivil08/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 30 | 2015-01-29T14:06:05.000Z | 2022-01-10T07:47:29.000Z | release/scripts/startup/bl_ui/space_time.py | ttagu99/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 1 | 2017-02-20T20:57:48.000Z | 2018-12-19T23:44:38.000Z | release/scripts/startup/bl_ui/space_time.py | ttagu99/blendocv | f6cce83e1f149fef39afa8043aade9c64378f33e | [
"Unlicense"
] | 15 | 2015-04-23T02:38:36.000Z | 2021-03-01T20:09:39.000Z | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 32.064356 | 108 | 0.634399 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 0 | 0 | 0 | 5,382 | 0 | 0 | 0 | 13 | 160 |
437fb43800560b6c05ed828ececa2384602ba7dd | 682 | py | Python | mosdef_cp2kmcpy/utilities/check_ensemble.py | ramanishsingh/mosdef_cp2kmcpy | 6348b9a55bef9fbfdb7d22b7df51c03802dccc0a | [
"MIT"
] | null | null | null | mosdef_cp2kmcpy/utilities/check_ensemble.py | ramanishsingh/mosdef_cp2kmcpy | 6348b9a55bef9fbfdb7d22b7df51c03802dccc0a | [
"MIT"
] | null | null | null | mosdef_cp2kmcpy/utilities/check_ensemble.py | ramanishsingh/mosdef_cp2kmcpy | 6348b9a55bef9fbfdb7d22b7df51c03802dccc0a | [
"MIT"
] | null | null | null | def pressure_ensemble(val):
"""
:param val: string, Name of the ensemble
:return: boolean, returns True if pressure should be specified
"""
if val=='NPE_F' or val=='NPE_I' or val=='NPT_F' or val=='NPT_I' or val=='NPT_GEMC':
return True
else:
return False
def temperat... | 31 | 150 | 0.609971 | def pressure_ensemble(val):
"""
:param val: string, Name of the ensemble
:return: boolean, returns True if pressure should be specified
"""
if val=='NPE_F' or val=='NPE_I' or val=='NPT_F' or val=='NPT_I' or val=='NPT_GEMC':
return True
else:
return False
def temperat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b3b1d9888129f4fa04533a21743017a4356036c | 2,844 | py | Python | updater.py | apotato369550/python-malware-scanner | 9919c2fa6365c7fe8787e3630eea55f4eab078b2 | [
"MIT"
] | null | null | null | updater.py | apotato369550/python-malware-scanner | 9919c2fa6365c7fe8787e3630eea55f4eab078b2 | [
"MIT"
] | null | null | null | updater.py | apotato369550/python-malware-scanner | 9919c2fa6365c7fe8787e3630eea55f4eab078b2 | [
"MIT"
] | null | null | null | import BeautifulSoup
| 28.727273 | 80 | 0.570675 | import Tkinter as tk
from Tkinter import *
import BeautifulSoup
from BeautifulSoup import BeautifulSoup
import re
import config
import os
def successPopup():
popup = tk.Tk()
popup.geometry("200x50")
error = Label(popup, text="Success!")
okButton = Button(popup, text="OK", command=popup.dest... | 0 | 0 | 0 | 0 | 0 | 2,547 | 0 | -15 | 288 |
2b0ad70c6f1cf74e03bb86f880ff282a890a4cea | 13,418 | py | Python | tools/gen_records.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | null | null | null | tools/gen_records.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | 1 | 2021-05-06T16:26:32.000Z | 2021-06-28T17:26:09.000Z | tools/gen_records.py | charlieDurnsfordHollands/utilities | 5306d6f96502f7c4c808d2fd9fe10572b39dfb90 | [
"MIT"
] | 3 | 2021-06-16T13:55:09.000Z | 2021-09-10T13:11:58.000Z | """Module for generating test messages for the new APEL system.
It will currently generate job messages or summary messages, depending on
command-line arguments, but shouldn't be difficult to extend to other types of
message. Create a subclass of RecordGenerator for each message type.
"""
import getopt
import os
imp... | 34.229592 | 125 | 0.602698 | """Module for generating test messages for the new APEL system.
It will currently generate job messages or summary messages, depending on
command-line arguments, but shouldn't be difficult to extend to other types of
message. Create a subclass of RecordGenerator for each message type.
"""
import getopt
import os
imp... | 0 | 0 | 0 | 9,961 | 0 | 147 | 0 | 0 | 92 |