hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76a915225b9d538cc6160c9fa2f49142fdeadf5 | 3,814 | py | Python | openpype/settings/entities/__init__.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | null | null | null | openpype/settings/entities/__init__.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | null | null | null | openpype/settings/entities/__init__.py | dangerstudios/OpenPype | 10ddcc4699137888616eec57cd7fac9648189714 | [
"MIT"
] | null | null | null | """OpenPype Settings
Settings define how openpype and it's modules behave. They became main
component of dynamism.
OpenPype settings (ATM) have 3 layers:
1.) Defaults - defined in code
2.) Studio overrides - values that are applied on default that may modify only
some values or None, result can be called "studio ... | 23.689441 | 78 | 0.741479 |
from .exceptions import (
SchemaError,
DefaultsNotDefined,
StudioDefaultsNotDefined,
InvalidValueType,
InvalidKeySymbols,
SchemaMissingFileInfo,
SchemeGroupHierarchyBug,
SchemaDuplicatedKeys,
SchemaDuplicatedEnvGroupKeys,
SchemaTemplateMissingKeys
)
from .lib import (
NOT_SE... | true | true |
f76a91eaa1bccaf94a83e778f61ae731e23e5609 | 751 | py | Python | Crux_pivo/Crux_pivo/urls.py | Ashwarrior/Crux_Pivot | 1e7c03f417246cc9e7acf439d98ab9b19636ebf1 | [
"Apache-2.0"
] | null | null | null | Crux_pivo/Crux_pivo/urls.py | Ashwarrior/Crux_Pivot | 1e7c03f417246cc9e7acf439d98ab9b19636ebf1 | [
"Apache-2.0"
] | null | null | null | Crux_pivo/Crux_pivo/urls.py | Ashwarrior/Crux_Pivot | 1e7c03f417246cc9e7acf439d98ab9b19636ebf1 | [
"Apache-2.0"
] | null | null | null | """Crux_pivo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 34.136364 | 77 | 0.70972 | from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
]
| true | true |
f76a952a19408b17bfcfa6f08556e7736cc39daf | 8,150 | py | Python | feature_extraction/src/2_graph_analysis/main_gspan_subgraph_generator.py | HPAI-BSC/chromoplexy_analysis | 07170ab878ade82ebd2d75a43cbead84c8c10d73 | [
"BSD-3-Clause"
] | 1 | 2018-06-28T10:12:48.000Z | 2018-06-28T10:12:48.000Z | feature_extraction/src/2_graph_analysis/main_gspan_subgraph_generator.py | HPAI-BSC/chromoplexy_analysis | 07170ab878ade82ebd2d75a43cbead84c8c10d73 | [
"BSD-3-Clause"
] | null | null | null | feature_extraction/src/2_graph_analysis/main_gspan_subgraph_generator.py | HPAI-BSC/chromoplexy_analysis | 07170ab878ade82ebd2d75a43cbead84c8c10d73 | [
"BSD-3-Clause"
] | 1 | 2019-08-30T12:51:19.000Z | 2019-08-30T12:51:19.000Z | '''
Reads chromoplexy breaks, generates a graph using a sliding window of fixed size, and stores all the resulting connected subraphs in a file compatible with an implementation of gSpan [1].
Discards all subgraphs with less than 3 vertices or 3 edges.
[1] https://github.com/betterenvi/gSpan
'''
import os
import sys
... | 36.711712 | 187 | 0.540123 | '''
Reads chromoplexy breaks, generates a graph using a sliding window of fixed size, and stores all the resulting connected subraphs in a file compatible with an implementation of gSpan [1].
Discards all subgraphs with less than 3 vertices or 3 edges.
[1] https://github.com/betterenvi/gSpan
'''
import os
import sys
... | false | true |
f76a95bd343a3279ae35b9ef485a02c4dcce9659 | 260 | py | Python | vvs_app/nodes/__init__.py | Sheriff99yt/Vision_Visual_Scripting | a930c805ff91379baf5cbb08d08b7f383eab2f95 | [
"MIT"
] | 5 | 2021-12-17T06:52:11.000Z | 2021-12-20T19:52:57.000Z | vvs_app/nodes/__init__.py | Sheriff99yt/Vision_Visual_Scripting | a930c805ff91379baf5cbb08d08b7f383eab2f95 | [
"MIT"
] | null | null | null | vvs_app/nodes/__init__.py | Sheriff99yt/Vision_Visual_Scripting | a930c805ff91379baf5cbb08d08b7f383eab2f95 | [
"MIT"
] | null | null | null | # __all__ = [ "operations", "input", "output" ]
from os.path import dirname, basename, isfile, join
import glob
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
| 32.5 | 92 | 0.688462 |
from os.path import dirname, basename, isfile, join
import glob
modules = glob.glob(join(dirname(__file__), "*.py"))
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
| true | true |
f76a95fec07adb65d55dbe3f5f4bd2b5e154ba7c | 10,750 | py | Python | Coloring/simple_YCC_resnet.py | MuAuan/llightning-pytorch | 38dc9ed75dd8e6f4a2a05e5a10072a549dcbf4d6 | [
"MIT"
] | null | null | null | Coloring/simple_YCC_resnet.py | MuAuan/llightning-pytorch | 38dc9ed75dd8e6f4a2a05e5a10072a549dcbf4d6 | [
"MIT"
] | null | null | null | Coloring/simple_YCC_resnet.py | MuAuan/llightning-pytorch | 38dc9ed75dd8e6f4a2a05e5a10072a549dcbf4d6 | [
"MIT"
] | null | null | null | import os
import time
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import torchvision
from torchvision.datasets import CIFAR10 #MNIST
from torch.utils.data import DataLoader, random_split
from torchvision import transforms
import pytorch_lightning as pl
import matplotlib.pyplot... | 39.667897 | 224 | 0.621395 | import os
import time
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import torchvision
from torchvision.datasets import CIFAR10 from torch.utils.data import DataLoader, random_split
from torchvision import transforms
import pytorch_lightning as pl
import matplotlib.pyplot as plt... | true | true |
f76a96623495f5dc7aeed00aafff5a3878e14054 | 2,998 | py | Python | bitmovin_api_sdk/models/imsc_styling.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/models/imsc_styling.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/models/imsc_styling.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | # coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
from bitmovin_api_sdk.models.imsc_styling_mode import ImscStylingMode
import pprint
import six
class ImscStyling(object):
@poscheck_model
def __init__(self,
... | 28.283019 | 164 | 0.577051 |
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
from bitmovin_api_sdk.models.imsc_styling_mode import ImscStylingMode
import pprint
import six
class ImscStyling(object):
@poscheck_model
def __init__(self,
mode=None):
... | true | true |
f76a972c31b4f79ee610663fade54329416283cb | 386 | py | Python | data/external/repositories_2to3/132160/kaggle-ndsb-master/average_predictions.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/132160/kaggle-ndsb-master/average_predictions.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/132160/kaggle-ndsb-master/average_predictions.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | import numpy as np
import sys
if len(sys.argv) < 3:
sys.exit("Usage: python average_predictions.py <predictions_file1> [predictions_file_2] [...] <output_file>")
predictions_paths = sys.argv[1:-1]
target_path = sys.argv[-1]
predictions = [np.load(path) for path in predictions_paths]
avg_predictions = np.... | 32.166667 | 114 | 0.733161 | import numpy as np
import sys
if len(sys.argv) < 3:
sys.exit("Usage: python average_predictions.py <predictions_file1> [predictions_file_2] [...] <output_file>")
predictions_paths = sys.argv[1:-1]
target_path = sys.argv[-1]
predictions = [np.load(path) for path in predictions_paths]
avg_predictions = np.... | true | true |
f76a976cbba9a5ceecdd6ee1470f85f92ea613ba | 44,475 | py | Python | tests/sentry/event_manager/test_event_manager.py | mlapkin/sentry | 83a852b7a2ff5154a9e65721e031582c4c3ca9c3 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/event_manager/test_event_manager.py | mlapkin/sentry | 83a852b7a2ff5154a9e65721e031582c4c3ca9c3 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/event_manager/test_event_manager.py | mlapkin/sentry | 83a852b7a2ff5154a9e65721e031582c4c3ca9c3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import logging
import mock
import pytest
import uuid
from collections import namedtuple
from datetime import datetime, timedelta
from django.utils import timezone
from time import time
from sentry.app import tsdb
from sentry.constants im... | 32.321948 | 101 | 0.560135 |
from __future__ import absolute_import, print_function
import logging
import mock
import pytest
import uuid
from collections import namedtuple
from datetime import datetime, timedelta
from django.utils import timezone
from time import time
from sentry.app import tsdb
from sentry.constants import VERSION_LENGTH
from... | true | true |
f76a995437eeab735becc2b681073fb00776349c | 145 | py | Python | 28/00/0.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | 28/00/0.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | 32 | 2017-09-01T00:52:17.000Z | 2017-10-01T00:30:02.000Z | 28/00/0.py | pylangstudy/201709 | 53d868786d7327a83bfa7f4149549c6f9855a6c6 | [
"CC0-1.0"
] | null | null | null | import cmath
import math
j = complex(-1.0, 0.0)
print('cmath.phase')
print(cmath.phase(j))
print('math.atan2')
print(math.atan2(j.imag, j.real))
| 18.125 | 33 | 0.703448 | import cmath
import math
j = complex(-1.0, 0.0)
print('cmath.phase')
print(cmath.phase(j))
print('math.atan2')
print(math.atan2(j.imag, j.real))
| true | true |
f76a9ada88b501851cadcf72e919e70c3172905b | 1,673 | py | Python | Xgboost_prac/UCI_CAD/UCI_test.py | JiaxiangBU/xgboost-LightGBM_demo | ea9b443121c8124340b5906340a0b9d5a098ac1a | [
"Apache-2.0"
] | null | null | null | Xgboost_prac/UCI_CAD/UCI_test.py | JiaxiangBU/xgboost-LightGBM_demo | ea9b443121c8124340b5906340a0b9d5a098ac1a | [
"Apache-2.0"
] | null | null | null | Xgboost_prac/UCI_CAD/UCI_test.py | JiaxiangBU/xgboost-LightGBM_demo | ea9b443121c8124340b5906340a0b9d5a098ac1a | [
"Apache-2.0"
] | 4 | 2019-08-08T14:59:17.000Z | 2021-03-18T07:44:34.000Z | import numpy as np
import time
import pandas as pd
from xgboost.sklearn import XGBClassifier
from sklearn import preprocessing
from sklearn.model_selection import KFold
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import accuracy_score
data_np=np.array(pd.read_csv('./UCI_CAD.csv'))
X=np.array([l... | 32.173077 | 79 | 0.730424 | import numpy as np
import time
import pandas as pd
from xgboost.sklearn import XGBClassifier
from sklearn import preprocessing
from sklearn.model_selection import KFold
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import accuracy_score
data_np=np.array(pd.read_csv('./UCI_CAD.csv'))
X=np.array([l... | true | true |
f76a9b817508d45d6260b8a83f29d36d3399c738 | 1,963 | py | Python | wikipedia.py | mastermanas805/Atlantis_Assement | f1080a97e5a530746b77b60f9b25b855ee3ddf61 | [
"MIT"
] | null | null | null | wikipedia.py | mastermanas805/Atlantis_Assement | f1080a97e5a530746b77b60f9b25b855ee3ddf61 | [
"MIT"
] | null | null | null | wikipedia.py | mastermanas805/Atlantis_Assement | f1080a97e5a530746b77b60f9b25b855ee3ddf61 | [
"MIT"
] | null | null | null |
"""
task - Write a python program to scrape a given wikipedia page
and return the average of 3 letter, 4 letter and 5 letter
words per paragraph.
Observation - Wikipedia stores all the paragraphs in div with id = content
"""
import requests
from bs4 import BeautifulSoup
import math
class wiki:
"... | 27.263889 | 239 | 0.512481 |
import requests
from bs4 import BeautifulSoup
import math
class wiki:
three = []
four = []
five = []
def __init__(self):
data = self.fetchData()
self.data = self.filterData(data)
self.output()
def output(self):
print(f"Output: 3-letter words: {math.floo... | true | true |
f76a9cb77cb1680d24df6ea86e2fc0ca4027d2ee | 612 | py | Python | review/migrations/0019_gradecomponent_display.py | kgdunn/peer-review-system | 1fd5ac9d0f84d7637a86682e9e5fc068ac404afd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | review/migrations/0019_gradecomponent_display.py | kgdunn/peer-review-system | 1fd5ac9d0f84d7637a86682e9e5fc068ac404afd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | review/migrations/0019_gradecomponent_display.py | kgdunn/peer-review-system | 1fd5ac9d0f84d7637a86682e9e5fc068ac404afd | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-28 15:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('review', '0018_gradecomponent_mandatory'),
]
operations = [
migrations.AddF... | 29.142857 | 199 | 0.665033 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('review', '0018_gradecomponent_mandatory'),
]
operations = [
migrations.AddField(
model_name='gradecomponent',
name='display'... | true | true |
f76a9cb93269ee672377d4b5fb6c17d9ca3b0b95 | 1,112 | py | Python | binarytodmx_test.py | me701/project-1-kellim521 | d72548aa4ae864178e8eae856eeb9da70c2914af | [
"MIT"
] | null | null | null | binarytodmx_test.py | me701/project-1-kellim521 | d72548aa4ae864178e8eae856eeb9da70c2914af | [
"MIT"
] | null | null | null | binarytodmx_test.py | me701/project-1-kellim521 | d72548aa4ae864178e8eae856eeb9da70c2914af | [
"MIT"
] | 1 | 2020-11-29T21:20:44.000Z | 2020-11-29T21:20:44.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 12 22:03:22 2020
@author: kelli
"""
from binarytodmx import *
import unittest
import filecmp
class TestDMX(unittest.TestCase):
def test_volcano(self):
""" test with frame data in np array from volcano.sc2
uses rc2 tools to... | 27.121951 | 71 | 0.563849 |
from binarytodmx import *
import unittest
import filecmp
class TestDMX(unittest.TestCase):
def test_volcano(self):
volcano = rc2.RC2('volcano.sc2')
volcanoFrames = volcano.read()
volcanoTest = DMX(volcanoFrames, 0, 1466, 1)
volcanoTest.write('VolcanoTe... | true | true |
f76a9e25e65c28dd22fe201da585414be6c849b9 | 1,828 | py | Python | tests/agent/test_polynomial_model.py | iryzhkov/stock-trading-backend | 7161026b7b4deb78a934b66550c85a27c6b32933 | [
"MIT"
] | 1 | 2021-01-27T18:24:02.000Z | 2021-01-27T18:24:02.000Z | tests/agent/test_polynomial_model.py | iryzhkov/stock-trading-backend | 7161026b7b4deb78a934b66550c85a27c6b32933 | [
"MIT"
] | null | null | null | tests/agent/test_polynomial_model.py | iryzhkov/stock-trading-backend | 7161026b7b4deb78a934b66550c85a27c6b32933 | [
"MIT"
] | null | null | null | """Unit tests for PolynomialModel class
"""
import os
import unittest
import pandas as pd
from stock_trading_backend.agent import PolynomialModel
class TestPolynomialModel(unittest.TestCase):
"""Unit tests for PolynomialModel class.
"""
def test_initializes(self):
"""Checks if model initializes ... | 35.153846 | 96 | 0.615427 | import os
import unittest
import pandas as pd
from stock_trading_backend.agent import PolynomialModel
class TestPolynomialModel(unittest.TestCase):
def test_initializes(self):
model = PolynomialModel(degree=5)
self.assertEqual(5, model.degree)
with self.assertRaises(ValueError):
... | true | true |
f76a9e7591dbbdc2d669a6019af4baaf6c9fc10d | 1,253 | py | Python | src/monkey_team/forms.py | ionelmc/django-monkey-team | 7da6c71fce0a9d1179fe498bcfe1774659e17c85 | [
"BSD-2-Clause"
] | 8 | 2015-01-21T17:00:23.000Z | 2021-07-01T15:10:21.000Z | src/monkey_team/forms.py | ionelmc/django-monkey-team | 7da6c71fce0a9d1179fe498bcfe1774659e17c85 | [
"BSD-2-Clause"
] | 1 | 2015-03-09T11:04:30.000Z | 2015-03-09T11:04:30.000Z | src/monkey_team/forms.py | ionelmc/django-monkey-team | 7da6c71fce0a9d1179fe498bcfe1774659e17c85 | [
"BSD-2-Clause"
] | 1 | 2015-01-05T13:34:39.000Z | 2015-01-05T13:34:39.000Z | from Crypto.Cipher import AES
from django import forms
from django.forms import ValidationError
from .utils import get_decode_key
class DecodeForm(forms.Form):
optional_decode_key = forms.CharField(required=False)
message = forms.CharField(widget=forms.Textarea, required=True)
def clean_optional_decode_k... | 33.864865 | 78 | 0.647247 | from Crypto.Cipher import AES
from django import forms
from django.forms import ValidationError
from .utils import get_decode_key
class DecodeForm(forms.Form):
optional_decode_key = forms.CharField(required=False)
message = forms.CharField(widget=forms.Textarea, required=True)
def clean_optional_decode_k... | true | true |
f76a9f9679d97b2e3394c88364b19fd3c6de50ff | 216 | py | Python | actionlogger/apps.py | andressamagblr/vault | f37d61b93a96d91278b5d4163f336ada7209240f | [
"Apache-2.0"
] | 15 | 2015-03-19T13:05:06.000Z | 2021-08-13T19:17:25.000Z | actionlogger/apps.py | andressamagblr/vault | f37d61b93a96d91278b5d4163f336ada7209240f | [
"Apache-2.0"
] | 24 | 2015-02-24T14:20:06.000Z | 2021-12-15T13:33:52.000Z | actionlogger/apps.py | andressamagblr/vault | f37d61b93a96d91278b5d4163f336ada7209240f | [
"Apache-2.0"
] | 11 | 2016-09-12T07:54:01.000Z | 2021-10-31T20:26:43.000Z | # -*- coding: utf-8 -*-
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ActionloggerConfig(AppConfig):
name = 'actionlogger'
verbose_name = _("Actionlogger")
| 21.6 | 54 | 0.736111 |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ActionloggerConfig(AppConfig):
name = 'actionlogger'
verbose_name = _("Actionlogger")
| true | true |
f76a9ff7d0bcafcd992e5a8aa5614fc35a7495ef | 3,792 | py | Python | DataStructuresandAlgorithmsInPython/com/kranthi/Algorithms/greedy_algorithm/design_in_memory_file_system.py | kbaddepuri/DataStructuresInPython | fbd5222e175f07922ee944c612c6b516b8d55211 | [
"BSD-3-Clause"
] | null | null | null | DataStructuresandAlgorithmsInPython/com/kranthi/Algorithms/greedy_algorithm/design_in_memory_file_system.py | kbaddepuri/DataStructuresInPython | fbd5222e175f07922ee944c612c6b516b8d55211 | [
"BSD-3-Clause"
] | 1 | 2020-09-30T16:09:59.000Z | 2020-09-30T16:09:59.000Z | DataStructuresandAlgorithmsInPython/com/kranthi/Algorithms/greedy_algorithm/design_in_memory_file_system.py | kbaddepuri/DataStructuresInPython | fbd5222e175f07922ee944c612c6b516b8d55211 | [
"BSD-3-Clause"
] | 2 | 2020-09-30T14:18:47.000Z | 2021-09-30T16:07:27.000Z |
# Time: ls: O(l + klogk), l is the path length, k is the number of entries in the last level directory
# mkdir: O(l)
# addContentToFile: O(l + c), c is the content size
# readContentFromFile: O(l + c)
# Space: O(n + s), n is the number of dir/file nodes, s is the total content size.
# Design an ... | 34.162162 | 103 | 0.625 |
# If it is a directory path, return the list of file and directory names in this directory.
# Your output (file and directory names together) should in lexicographic order.
#
# mkdir: Given a directory path that does not exist,
# you should make a new directory according to the path.
# If the midd... | true | true |
f76aa04bc24a571dfe92772fb7e0dce305e83149 | 24,290 | py | Python | lo-fi-machine/processing/package/pooch/downloaders.py | rochelletham/weezify | 910c62d0ec14bc5a7aaa4f7dca80c0ca14c4c060 | [
"MIT"
] | 214 | 2018-07-21T19:21:45.000Z | 2022-03-25T01:46:41.000Z | lo-fi-machine/processing/package/pooch/downloaders.py | rochelletham/lo-tify | 910c62d0ec14bc5a7aaa4f7dca80c0ca14c4c060 | [
"MIT"
] | 194 | 2018-07-20T23:09:05.000Z | 2022-03-14T14:50:29.000Z | lo-fi-machine/processing/package/pooch/downloaders.py | rochelletham/lo-tify | 910c62d0ec14bc5a7aaa4f7dca80c0ca14c4c060 | [
"MIT"
] | 48 | 2018-07-23T21:20:55.000Z | 2022-03-25T01:46:46.000Z | # Copyright (c) 2018 The Pooch Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
The classes that actually handle the downloads.
"""
import sys
import ftplib
import reques... | 36.145833 | 87 | 0.608646 | import sys
import ftplib
import requests
from .utils import parse_url
try:
from tqdm import tqdm
except ImportError:
tqdm = None
try:
import paramiko
except ImportError:
paramiko = None
def choose_downloader(url, progressbar=False):
known_downloaders = {
"ftp": FTPDownloader,
"... | true | true |
f76aa04f015079a8f21298985804dcf92fffa50b | 1,835 | py | Python | trove/guestagent/strategies/replication/mysql_gtid.py | cp16net/trove | 5daa2d6aa06c56482c3e65d52469743cfcf54535 | [
"Apache-2.0"
] | null | null | null | trove/guestagent/strategies/replication/mysql_gtid.py | cp16net/trove | 5daa2d6aa06c56482c3e65d52469743cfcf54535 | [
"Apache-2.0"
] | null | null | null | trove/guestagent/strategies/replication/mysql_gtid.py | cp16net/trove | 5daa2d6aa06c56482c3e65d52469743cfcf54535 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Tesora, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 36.7 | 78 | 0.666485 |
from oslo_log import log as logging
from trove.common import cfg
from trove.guestagent.backup.backupagent import BackupAgent
from trove.guestagent.strategies.replication import mysql_base
AGENT = BackupAgent()
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
class MysqlGTIDReplication(mysql_base.MysqlReplication... | true | true |
f76aa1d9621e88225dce18778f5a2cd7f4fce0cc | 10,077 | py | Python | obsolete/reports/pipeline_capseq/trackers/macs_shared_intervals.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 11 | 2018-09-07T11:33:23.000Z | 2022-01-07T12:16:11.000Z | obsolete/reports/pipeline_capseq/trackers/macs_shared_intervals.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 102 | 2018-03-22T15:35:26.000Z | 2022-03-23T17:46:16.000Z | obsolete/reports/pipeline_capseq/trackers/macs_shared_intervals.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 7 | 2018-06-11T15:01:41.000Z | 2020-03-31T09:29:33.000Z | import os
import sys
import re
import types
import itertools
import matplotlib.pyplot as plt
import numpy
import scipy.stats
import numpy.ma
import Stats
import Histogram
from cgatReport.Tracker import *
from cpgReport import *
##########################################################################
class SharedI... | 37.741573 | 126 | 0.51682 | import os
import sys
import re
import types
import itertools
import matplotlib.pyplot as plt
import numpy
import scipy.stats
import numpy.ma
import Stats
import Histogram
from cgatReport.Tracker import *
from cpgReport import *
class SharedIntervals(cpgTracker):
mPattern = "_merged_shared_intervals$"
def... | true | true |
f76aa1db5d6165698e266adb546f83e1b52b8ea9 | 4,798 | py | Python | gobbli/model/use/model.py | RTIInternational/gobbli | d9ec8132f74ce49dc4bead2fad25b661bcef6e76 | [
"Apache-2.0"
] | 276 | 2019-09-13T08:25:51.000Z | 2022-03-05T13:07:55.000Z | gobbli/model/use/model.py | RTIInternational/gobbli | d9ec8132f74ce49dc4bead2fad25b661bcef6e76 | [
"Apache-2.0"
] | 15 | 2019-09-06T14:05:30.000Z | 2022-01-01T20:15:06.000Z | gobbli/model/use/model.py | RTIInternational/gobbli | d9ec8132f74ce49dc4bead2fad25b661bcef6e76 | [
"Apache-2.0"
] | 24 | 2019-09-18T15:11:42.000Z | 2021-12-23T18:59:55.000Z | import json
import shutil
import tempfile
from pathlib import Path
from typing import Any, Dict, List
import numpy as np
import gobbli.io
from gobbli.docker import run_container
from gobbli.model.base import BaseModel
from gobbli.model.context import ContainerTaskContext
from gobbli.model.mixin import EmbedMixin
from... | 34.517986 | 153 | 0.638183 | import json
import shutil
import tempfile
from pathlib import Path
from typing import Any, Dict, List
import numpy as np
import gobbli.io
from gobbli.docker import run_container
from gobbli.model.base import BaseModel
from gobbli.model.context import ContainerTaskContext
from gobbli.model.mixin import EmbedMixin
from... | true | true |
f76aa26f662c8d0af28bb567098e9f454cceab50 | 3,607 | py | Python | bindings/python/ensmallen/datasets/string/sphingobacteriaceaebacteriumdw12.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-09-10T18:31:58.000Z | 2022-03-24T04:28:04.000Z | bindings/python/ensmallen/datasets/string/sphingobacteriaceaebacteriumdw12.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/sphingobacteriaceaebacteriumdw12.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Sphingobacteriaceae bacterium DW12.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: prot... | 33.398148 | 223 | 0.682007 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def SphingobacteriaceaeBacteriumDw12(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "... | true | true |
f76aa2d9756116d88a06de81c85489244ba7dbcc | 12,867 | py | Python | oscar/apps/checkout/mixins.py | DrOctogon/unwash_ecom | f78fc87f5dbca86a483ca9cfa7fb6f302d15b741 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/checkout/mixins.py | DrOctogon/unwash_ecom | f78fc87f5dbca86a483ca9cfa7fb6f302d15b741 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/checkout/mixins.py | DrOctogon/unwash_ecom | f78fc87f5dbca86a483ca9cfa7fb6f302d15b741 | [
"BSD-3-Clause"
] | null | null | null | import logging
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse, NoReverseMatch
from django.contrib.sites.models import Site, get_current_site
from django.core.exceptions import ObjectDoesNotExist
from oscar.core.loading import get_class, get_model
OrderCreator = get_class('o... | 38.294643 | 79 | 0.635502 | import logging
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse, NoReverseMatch
from django.contrib.sites.models import Site, get_current_site
from django.core.exceptions import ObjectDoesNotExist
from oscar.core.loading import get_class, get_model
OrderCreator = get_class('o... | true | true |
f76aa35386806bdb131ad49e161f4a4043a67761 | 2,899 | py | Python | tests/unit/models/ci/zuul/test_test.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 3 | 2022-02-17T18:07:07.000Z | 2022-03-19T10:22:38.000Z | tests/unit/models/ci/zuul/test_test.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 58 | 2022-02-14T14:41:22.000Z | 2022-03-31T10:54:28.000Z | tests/unit/models/ci/zuul/test_test.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 6 | 2022-02-14T19:21:26.000Z | 2022-03-29T09:31:31.000Z | """
# Copyright 2022 Red Hat
#
# 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 agr... | 29.886598 | 78 | 0.638496 | from unittest import TestCase
from unittest.mock import Mock
from cibyl.models.ci.zuul.test import Test, TestKind, TestStatus
class TestTest(TestCase):
def test_attributes(self):
kind = TestKind.ANSIBLE
name = 'test'
status = TestStatus.SUCCESS
duration = 1.2
url = 'url-t... | true | true |
f76aa436dc2741fa38b68eff26c9bed6611aea52 | 981 | py | Python | src/samples/__init__.py | DanEdens/azure-devops-python-samples | fc35e4bee37deb0553a8c907a3c1bf11088a5f9d | [
"MIT"
] | 65 | 2019-05-22T14:15:11.000Z | 2022-03-23T21:04:23.000Z | src/samples/__init__.py | DanEdens/azure-devops-python-samples | fc35e4bee37deb0553a8c907a3c1bf11088a5f9d | [
"MIT"
] | 11 | 2018-10-15T07:49:53.000Z | 2019-05-03T21:18:31.000Z | src/samples/__init__.py | DanEdens/azure-devops-python-samples | fc35e4bee37deb0553a8c907a3c1bf11088a5f9d | [
"MIT"
] | 59 | 2019-05-07T07:48:27.000Z | 2022-03-17T20:49:28.000Z | import logging
from utils import emit
logger = logging.getLogger(__name__)
discovered_samples = {}
def resource(decorated_resource):
def decorate(sample_func):
def run(*args, **kwargs):
emit("Running `{0}.{1}`".format(sample_func.__module__, sample_func.__name__))
sample_func(*a... | 30.65625 | 90 | 0.678899 | import logging
from utils import emit
logger = logging.getLogger(__name__)
discovered_samples = {}
def resource(decorated_resource):
def decorate(sample_func):
def run(*args, **kwargs):
emit("Running `{0}.{1}`".format(sample_func.__module__, sample_func.__name__))
sample_func(*a... | true | true |
f76aa4854b25d1373b8b25ae5be47a065cf8fd48 | 4,119 | py | Python | Ag/Tutorial/Custom_graphs.py | unAlpha/AgManim | c34390af41d943c8785beee52015b22eb9df8bde | [
"MIT"
] | null | null | null | Ag/Tutorial/Custom_graphs.py | unAlpha/AgManim | c34390af41d943c8785beee52015b22eb9df8bde | [
"MIT"
] | 1 | 2020-06-25T15:31:24.000Z | 2021-04-02T09:53:39.000Z | Ag/Tutorial/Custom_graphs.py | unAlpha/AgManim | c34390af41d943c8785beee52015b22eb9df8bde | [
"MIT"
] | null | null | null | from manimlib.imports import *
class DataRead(GraphScene):
def construct(self):
self.setup_axes()
coords = self.return_coords()
dots = VGroup(*[Dot().move_to(self.coords_to_point(coord[0],coord[1]))\
for coord in coords])
self.add(dots)
Line()
def... | 30.065693 | 80 | 0.582666 | from manimlib.imports import *
class DataRead(GraphScene):
def construct(self):
self.setup_axes()
coords = self.return_coords()
dots = VGroup(*[Dot().move_to(self.coords_to_point(coord[0],coord[1]))\
for coord in coords])
self.add(dots)
Line()
def... | true | true |
f76aa4d45385ffb71aa040dd32c0173c0a741f7c | 129 | py | Python | srt_modules/__init__.py | sjkcarnahan/simple_ray_trace | a69bd1bd226b44139c6e0192bfe35f6966b6ff54 | [
"MIT"
] | null | null | null | srt_modules/__init__.py | sjkcarnahan/simple_ray_trace | a69bd1bd226b44139c6e0192bfe35f6966b6ff54 | [
"MIT"
] | null | null | null | srt_modules/__init__.py | sjkcarnahan/simple_ray_trace | a69bd1bd226b44139c6e0192bfe35f6966b6ff54 | [
"MIT"
] | null | null | null | '''
Scott Carnahan
This allows these files to imported from throughout simple_ray_trace. It should be empty at least for now.
''' | 32.25 | 106 | 0.782946 | true | true | |
f76aa559b500c783f6222092931cf61647749419 | 9,870 | py | Python | opencc/opencc.py | david30907d/opencc-python | 473fe4216047612b4b520d20d43c6f7d2f2b8ebf | [
"Apache-2.0"
] | 3 | 2017-05-12T15:49:29.000Z | 2021-12-06T08:09:15.000Z | opencc/opencc.py | jokerYellow/TranslateFiles | f29cb52e55666e8a7d35a9b7bbf6af0fded8d5b3 | [
"Apache-2.0",
"MIT"
] | null | null | null | opencc/opencc.py | jokerYellow/TranslateFiles | f29cb52e55666e8a7d35a9b7bbf6af0fded8d5b3 | [
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import,
print_function)
##########################################################
# Author: Yichen Huang (Eugene)
# GitHub: https://github.com/yichen0831/opencc-python
# January, 2016
##########################... | 40.617284 | 115 | 0.557244 | from __future__ import (unicode_literals, division, absolute_import,
print_function)
import io
import os
import json
import re
CONFIG_DIR = 'config'
DICT_DIR = 'dictionary'
class OpenCC:
def __init__(self, conversion=None):
self.conversion_name = ''
self.conversion = con... | true | true |
f76aa69697a2a2fe861deff7e595dcb92e955710 | 2,887 | py | Python | dadmatools/utils/not-needed/datasets/ner/convert_fire_2013.py | njzr/DadmaTools | 64ff407d5d818d5a9216340cccf0d1cc909d3b1b | [
"Apache-2.0"
] | 25 | 2021-12-01T15:19:36.000Z | 2022-03-12T12:50:28.000Z | dadmatools/utils/not-needed/datasets/ner/convert_fire_2013.py | ebad84/DadmaTools | b26ad8aa834f642d49bd120bd7cf1fdf40741be1 | [
"Apache-2.0"
] | 3 | 2021-12-14T06:34:52.000Z | 2022-02-17T08:23:20.000Z | dadmatools/utils/not-needed/datasets/ner/convert_fire_2013.py | ebad84/DadmaTools | b26ad8aa834f642d49bd120bd7cf1fdf40741be1 | [
"Apache-2.0"
] | 6 | 2021-10-12T13:44:17.000Z | 2022-03-07T13:54:17.000Z | """
Converts the FIRE 2013 dataset to TSV
http://au-kbc.org/nlp/NER-FIRE2013/index.html
The dataset is in six tab separated columns. The columns are
word tag chunk ner1 ner2 ner3
This script keeps just the word and the ner1. It is quite possible that using the tag would help
"""
import argparse
import glob
impor... | 37.986842 | 150 | 0.648078 |
import argparse
import glob
import os
def normalize(entity):
if entity == 'o':
return "O"
return entity
def convert_fileset(output_csv_file, filenames):
sentences = []
for filename in filenames:
with open(filename) as fin:
next_sentence = []
for line in fin... | true | true |
f76aa6be8b4ddaf8b57278b32cf11d145350d772 | 10,338 | py | Python | python/paddle/incubate/hapi/vision/transforms/functional.py | licanisme/Paddle | d11c140e280880b9d031fa38361f3230aef6cf9c | [
"Apache-2.0"
] | 3 | 2021-06-11T06:48:10.000Z | 2021-09-02T10:18:06.000Z | python/paddle/incubate/hapi/vision/transforms/functional.py | 92lqllearning/Paddle | d11c140e280880b9d031fa38361f3230aef6cf9c | [
"Apache-2.0"
] | null | null | null | python/paddle/incubate/hapi/vision/transforms/functional.py | 92lqllearning/Paddle | d11c140e280880b9d031fa38361f3230aef6cf9c | [
"Apache-2.0"
] | 1 | 2020-11-05T08:41:11.000Z | 2020-11-05T08:41:11.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.118812 | 111 | 0.598665 |
import sys
import collections
import random
import math
import cv2
import numbers
import numpy as np
if sys.version_info < (3, 3):
Sequence = collections.Sequence
Iterable = collections.Iterable
else:
Sequence = collections.abc.Sequence
Iterable = collections.abc.Iterable
__all__ = ['flip', 'resize'... | true | true |
f76aa814ba23c4bbf491c263a3b8eaa70c98746f | 8,879 | py | Python | improver/cli/nbhood_land_and_sea.py | cpelley/improver | ebf77fe2adc85ed7aec74c26671872a2e4388ded | [
"BSD-3-Clause"
] | 77 | 2017-04-26T07:47:40.000Z | 2022-03-31T09:40:49.000Z | improver/cli/nbhood_land_and_sea.py | cpelley/improver | ebf77fe2adc85ed7aec74c26671872a2e4388ded | [
"BSD-3-Clause"
] | 1,440 | 2017-03-29T10:04:15.000Z | 2022-03-28T10:11:29.000Z | improver/cli/nbhood_land_and_sea.py | MoseleyS/improver | ca028e3a1c842e3ff00b188c8ea6eaedd0a07149 | [
"BSD-3-Clause"
] | 72 | 2017-03-17T16:53:45.000Z | 2022-02-16T09:41:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... | 42.280952 | 87 | 0.657056 | from improver import cli
@cli.clizefy
@cli.with_output
def process(
cube: cli.inputcube,
mask: cli.inputcube,
weights: cli.inputcube = None,
*,
radii: cli.comma_separated_list,
lead_times: cli.comma_separated_list = None,
area_sum=False,
):
import numpy as np
from improver.nbhood.... | true | true |
f76aa95e854df2542377350f21a82128ad0a48cb | 4,894 | py | Python | axiol/functions.py | Sigmanificient/Axiol | 7cd7183f0d4ad2999f25efa2808d786fad8826d3 | [
"MIT"
] | 2 | 2021-11-08T11:18:14.000Z | 2022-01-24T01:51:07.000Z | axiol/functions.py | Sigmanificient/Axiol | 7cd7183f0d4ad2999f25efa2808d786fad8826d3 | [
"MIT"
] | null | null | null | axiol/functions.py | Sigmanificient/Axiol | 7cd7183f0d4ad2999f25efa2808d786fad8826d3 | [
"MIT"
] | null | null | null | import asyncio
import random
from variables import DEFAULT_PREFIX
from database import PREFIXES, LEVEL_DATABASE, PLUGINS, PERMISSIONS
async def get_prefix(ctx):
prefix = await PREFIXES.find_one({"_id": ctx.guild.id})
if prefix is not None:
return prefix["prefix"]
else:
return DEFAULT_PREF... | 27.649718 | 77 | 0.569268 | import asyncio
import random
from variables import DEFAULT_PREFIX
from database import PREFIXES, LEVEL_DATABASE, PLUGINS, PERMISSIONS
async def get_prefix(ctx):
prefix = await PREFIXES.find_one({"_id": ctx.guild.id})
if prefix is not None:
return prefix["prefix"]
else:
return DEFAULT_PREF... | true | true |
f76aa97bc7d4f2faedb8eb147d9e7f97daa8b302 | 1,156 | py | Python | 12_Intermediate Data Visualization with Seaborn/02_Customizing Seaborn Plots/01_Setting the default style.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 5 | 2021-02-03T14:36:58.000Z | 2022-01-01T10:29:26.000Z | 12_Intermediate Data Visualization with Seaborn/02_Customizing Seaborn Plots/01_Setting the default style.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | null | null | null | 12_Intermediate Data Visualization with Seaborn/02_Customizing Seaborn Plots/01_Setting the default style.py | mohd-faizy/DataScience-With-Python | 13ebb10cf9083343056d5b782957241de1d595f9 | [
"MIT"
] | 3 | 2021-02-08T00:31:16.000Z | 2022-03-17T13:52:32.000Z | '''
01_Setting the default style
For these exercises, we will be looking at fair market rent values calculated by the
US Housing and Urban Development Department. This data is used to calculate guidelines
for several federal programs. The actual values for rents vary greatly across the US.
We can use this dat... | 34 | 91 | 0.772491 | df['fmr_2'].plot.hist()
plt.show()
plt.clf()
sns.set()
df['fmr_2'].plot.hist()
plt.show()
plt.clf() | true | true |
f76aa9a9f306d070575194330036a694d6f15eb8 | 559 | py | Python | libs/yowsup/yowsup/yowsup/layers/protocol_ib/protocolentities/test_dirty_ib.py | akshitpradhan/TomHack | 837226e7b38de1140c19bc2d478eeb9e379ed1fd | [
"MIT"
] | 22 | 2017-07-14T20:01:17.000Z | 2022-03-08T14:22:39.000Z | libs/yowsup/yowsup/yowsup/layers/protocol_ib/protocolentities/test_dirty_ib.py | akshitpradhan/TomHack | 837226e7b38de1140c19bc2d478eeb9e379ed1fd | [
"MIT"
] | 6 | 2017-07-14T21:03:50.000Z | 2021-06-10T19:08:32.000Z | libs/yowsup/yowsup/yowsup/layers/protocol_ib/protocolentities/test_dirty_ib.py | akshitpradhan/TomHack | 837226e7b38de1140c19bc2d478eeb9e379ed1fd | [
"MIT"
] | 13 | 2017-07-14T20:13:14.000Z | 2020-11-12T08:06:05.000Z | from yowsup.layers.protocol_ib.protocolentities.test_ib import IbProtocolEntityTest
from yowsup.layers.protocol_ib.protocolentities.dirty_ib import DirtyIbProtocolEntity
from yowsup.structs import ProtocolTreeNode
class DirtyIbProtocolEntityTest(IbProtocolEntityTest):
def setUp(self):
super(DirtyIbProtocolE... | 50.818182 | 85 | 0.77102 | from yowsup.layers.protocol_ib.protocolentities.test_ib import IbProtocolEntityTest
from yowsup.layers.protocol_ib.protocolentities.dirty_ib import DirtyIbProtocolEntity
from yowsup.structs import ProtocolTreeNode
class DirtyIbProtocolEntityTest(IbProtocolEntityTest):
def setUp(self):
super(DirtyIbProtocolE... | true | true |
f76aaa3897b48e31a948e283c2b5f124fc17767e | 1,364 | py | Python | _Books_/Python - Problem Solving with Algorithms and Data Structures using Python - Runestone/2. Analysis/Dictionaries Big_O Efficiency.py | JUD210/Study-Note | 2add9db3f11d99370f49878f0c19e9caa60d2d02 | [
"MIT"
] | null | null | null | _Books_/Python - Problem Solving with Algorithms and Data Structures using Python - Runestone/2. Analysis/Dictionaries Big_O Efficiency.py | JUD210/Study-Note | 2add9db3f11d99370f49878f0c19e9caa60d2d02 | [
"MIT"
] | null | null | null | _Books_/Python - Problem Solving with Algorithms and Data Structures using Python - Runestone/2. Analysis/Dictionaries Big_O Efficiency.py | JUD210/Study-Note | 2add9db3f11d99370f49878f0c19e9caa60d2d02 | [
"MIT"
] | null | null | null | # https://runestone.academy/runestone/static/pythonds/AlgorithmAnalysis/Dictionaries.html
# | Operation | Big-O Efficiency |
# | ------------- | ------------------------------- |
# | copy | O(n) |
# | get item | O(1) (in some rare cases: O(n)) |
# | set item... | 35.894737 | 93 | 0.486804 |
import timeit
import random
print(f"i{'list'.rjust(15)}{'dict'.rjust(14)}")
print("==================================")
for i in range(100_000, 1_000_001, 200_000):
t = timeit.Timer("random.randrange(%d) in x" % i, "from __main__ import random, x")
x = list(range(i)) lst_time = t.timeit(number=1000... | true | true |
f76aaa4a16687c86484ff4ef27801ca8542f7138 | 2,200 | py | Python | benchmark/startPyquil1044.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil1044.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil1044.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=51
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=3
pr... | 25 | 64 | 0.540455 | import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program()
prog += H(0) prog += H(1) prog += H(2) prog += H(3) prog += H(0)... | false | true |
f76aaafbfdbac059e59355ddfe63a8630b9f5080 | 3,553 | py | Python | cinder/tests/scheduler/test_capacity_weigher.py | CloudVPS/cinder | 9097b9407b6ce16c7b5678682284a0ad0fcc652d | [
"Apache-2.0"
] | null | null | null | cinder/tests/scheduler/test_capacity_weigher.py | CloudVPS/cinder | 9097b9407b6ce16c7b5678682284a0ad0fcc652d | [
"Apache-2.0"
] | null | null | null | cinder/tests/scheduler/test_capacity_weigher.py | CloudVPS/cinder | 9097b9407b6ce16c7b5678682284a0ad0fcc652d | [
"Apache-2.0"
] | null | null | null | # Copyright 2011-2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 38.619565 | 78 | 0.678581 |
import testtools
from cinder import context
from cinder.openstack.common.scheduler.weights import HostWeightHandler
from cinder.scheduler.weights.capacity import CapacityWeigher
from cinder import test
from cinder.tests.scheduler import fakes
from cinder.tests import utils as test_utils
class CapacityWeigherTestCa... | true | true |
f76aab84d258debc054a2954b85b73d0b9fcb737 | 6,542 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/5-19_7.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/5-19_7.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/5-19_7.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 34.251309 | 78 | 0.517884 | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
f76aabb038a11e1cb82ff6db63442d66fb78138a | 11,624 | py | Python | packages/python/plotly/plotly/graph_objs/scattergeo/selected/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | 2 | 2020-04-11T19:28:30.000Z | 2020-05-04T03:16:20.000Z | packages/python/plotly/plotly/graph_objs/scattergeo/selected/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/scattergeo/selected/__init__.py | potpath/plotly.py | 46cd47f441d8bda9b14b4ba66a33f02731faf8f0 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# color
# -----
@property
def color(self):
"""
Sets the text font color of selected points.
The 'color' property is a color and... | 34.390533 | 82 | 0.554026 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
@property
def color(self):
return self["color"]
@color.setter
def color(self, val):
self["color"] = val
@property
... | true | true |
f76aabffa9306454e2424ea08b0f6daff643eed5 | 6,643 | py | Python | scripts/python/docs-automation/sync_tocs.py | jongio/azure-sdk-tools | 0cf4a2ae7820afa2b93055254985e7a7bf08dd0e | [
"MIT"
] | null | null | null | scripts/python/docs-automation/sync_tocs.py | jongio/azure-sdk-tools | 0cf4a2ae7820afa2b93055254985e7a7bf08dd0e | [
"MIT"
] | null | null | null | scripts/python/docs-automation/sync_tocs.py | jongio/azure-sdk-tools | 0cf4a2ae7820afa2b93055254985e7a7bf08dd0e | [
"MIT"
] | null | null | null | # This script is intended for use in intermediate doc repos generated from docs.ms CI.
# Given a reference ToC and a set of namespaces, limit the reference to ToC entries that contain
# namespaces in our set.
import argparse
import pdb
import os
import fnmatch
import re
import json
# by default, yaml does not maintai... | 36.103261 | 126 | 0.688544 |
import argparse
import pdb
import os
import fnmatch
import re
import json
import oyaml as yaml
def filter_children(targeted_ns_list, known_namespaces):
amended_list = []
for ns in targeted_ns_list:
if any(
[
re.match(fnmatch.translate(ns), known_namespace... | true | true |
f76aacec2d4613ef0dc844f2aceb16130214dc80 | 2,829 | py | Python | keras/keras_neural_networks_training_70_30_random_20avg.py | sekharkaredla/ASAGS | 142173fc23bd42dcfdf74cf3850db445864f906a | [
"MIT"
] | 10 | 2018-08-02T09:31:19.000Z | 2022-01-27T19:46:30.000Z | keras/keras_neural_networks_training_70_30_random_20avg.py | sekharkaredla/Project | 142173fc23bd42dcfdf74cf3850db445864f906a | [
"MIT"
] | 3 | 2019-02-08T17:49:54.000Z | 2019-10-31T14:11:58.000Z | keras/keras_neural_networks_training_70_30_random_20avg.py | sekharkaredla/Project | 142173fc23bd42dcfdf74cf3850db445864f906a | [
"MIT"
] | 12 | 2018-04-08T07:48:59.000Z | 2021-12-10T16:44:22.000Z | from keras.models import Sequential
from keras.layers import Dense
from sklearn.metrics import confusion_matrix
import numpy as np
import random
import time
ovr_acc = 0.0
start_time = time.time()
for j in range(1,21):
X_train = np.empty((0,252))
Y_train = np.array([])
X_test = np.empty((0,252))
Y_test ... | 29.164948 | 89 | 0.559915 | from keras.models import Sequential
from keras.layers import Dense
from sklearn.metrics import confusion_matrix
import numpy as np
import random
import time
ovr_acc = 0.0
start_time = time.time()
for j in range(1,21):
X_train = np.empty((0,252))
Y_train = np.array([])
X_test = np.empty((0,252))
Y_test ... | false | true |
f76aacfa67523ea5e540f35b628bf978f7d3449c | 1,178 | py | Python | apitaxdrivers/ApitaxTests.py | Apitax/Drivers | 35b2c2f4c8ce8b98615f42fc30f04111d7b9bffe | [
"Apache-2.0"
] | null | null | null | apitaxdrivers/ApitaxTests.py | Apitax/Drivers | 35b2c2f4c8ce8b98615f42fc30f04111d7b9bffe | [
"Apache-2.0"
] | 4 | 2018-08-03T20:01:57.000Z | 2018-10-22T15:32:27.000Z | apitaxdrivers/ApitaxTests.py | Apitax/Drivers | 35b2c2f4c8ce8b98615f42fc30f04111d7b9bffe | [
"Apache-2.0"
] | null | null | null | from apitax.drivers.Driver import Driver
from apitax.utilities.Files import getAllFiles
from pathlib import Path
class ApitaxTestsDriver(Driver):
def isApiAuthenticated(self):
return False
def isTokenable(self):
return False
def getScriptsCatalog(self):
files = getAllFiles(self.c... | 36.8125 | 120 | 0.579796 | from apitax.drivers.Driver import Driver
from apitax.utilities.Files import getAllFiles
from pathlib import Path
class ApitaxTestsDriver(Driver):
def isApiAuthenticated(self):
return False
def isTokenable(self):
return False
def getScriptsCatalog(self):
files = getAllFiles(self.c... | true | true |
f76aad3623336b8d06584c98ce87aa5cc69f9ca3 | 5,466 | py | Python | stubs/micropython-v1_18-frozen/rp2/ARDUINO_NANO_RP2040_CONNECT/aioble/security.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | 1 | 2019-03-26T16:03:04.000Z | 2019-03-26T16:03:04.000Z | stubs/micropython-v1_18-frozen/rp2/ARDUINO_NANO_RP2040_CONNECT/aioble/security.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_18-frozen/rp2/ARDUINO_NANO_RP2040_CONNECT/aioble/security.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | # MicroPython aioble module
# MIT license; Copyright (c) 2021 Jim Mussared
from micropython import const, schedule
import uasyncio as asyncio
import binascii
import json
from .core import log_info, log_warn, ble, register_irq_handler
from .device import DeviceConnection
_IRQ_ENCRYPTION_UPDATE = const(28)
_IRQ_GET_SE... | 31.056818 | 136 | 0.641054 |
from micropython import const, schedule
import uasyncio as asyncio
import binascii
import json
from .core import log_info, log_warn, ble, register_irq_handler
from .device import DeviceConnection
_IRQ_ENCRYPTION_UPDATE = const(28)
_IRQ_GET_SECRET = const(29)
_IRQ_SET_SECRET = const(30)
_IRQ_PASSKEY_ACTION = const(31... | true | true |
f76aad7989030ea1b504b07ca59ffc0ac6b0b554 | 910 | py | Python | Laborator/lab01/demo.py | mihai-constantin/SPRC | 99f325c2e779111226473007d4808c25a8b7c8c7 | [
"MIT"
] | null | null | null | Laborator/lab01/demo.py | mihai-constantin/SPRC | 99f325c2e779111226473007d4808c25a8b7c8c7 | [
"MIT"
] | null | null | null | Laborator/lab01/demo.py | mihai-constantin/SPRC | 99f325c2e779111226473007d4808c25a8b7c8c7 | [
"MIT"
] | null | null | null | import requests
def get_method():
r = requests.get('https://en.wikipedia.org/wiki/Cat')
print(r.status_code)
print(r.headers['Content-Type'])
print(r.text)
# Save an image from an URL
def save_image():
image = requests.get('https://imgs.xkcd.com/comics/making_progress.png')
with open('/Users/m... | 26.764706 | 94 | 0.634066 | import requests
def get_method():
r = requests.get('https://en.wikipedia.org/wiki/Cat')
print(r.status_code)
print(r.headers['Content-Type'])
print(r.text)
def save_image():
image = requests.get('https://imgs.xkcd.com/comics/making_progress.png')
with open('/Users/mihai/Desktop/Semestrul 1/SPR... | true | true |
f76aad980c90394f09b69ca2fec78bba268e1910 | 129 | py | Python | FaceSwap-master/PRNet-master/utils/write.py | CSID-DGU/-2020-1-OSSP1-ninetynine-2 | b1824254882eeea0ee44e4e60896b72c51ef1d2c | [
"MIT"
] | 1 | 2020-06-21T13:45:26.000Z | 2020-06-21T13:45:26.000Z | FaceSwap-master/PRNet-master/utils/write.py | CSID-DGU/-2020-1-OSSP1-ninetynine-2 | b1824254882eeea0ee44e4e60896b72c51ef1d2c | [
"MIT"
] | null | null | null | FaceSwap-master/PRNet-master/utils/write.py | CSID-DGU/-2020-1-OSSP1-ninetynine-2 | b1824254882eeea0ee44e4e60896b72c51ef1d2c | [
"MIT"
] | 3 | 2020-09-02T03:18:45.000Z | 2021-01-27T08:24:05.000Z | version https://git-lfs.github.com/spec/v1
oid sha256:875706dfd94d1bec21c49c327ebbb5e3f5dd3e8024e55f076dddc507c43bef4d
size 5409
| 32.25 | 75 | 0.883721 | version https://git-lfs.github.com/spec/v1
oid sha256:875706dfd94d1bec21c49c327ebbb5e3f5dd3e8024e55f076dddc507c43bef4d
size 5409
| false | true |
f76aadaf8cfc34b64d618d614e4108d9965836c6 | 4,696 | py | Python | data/text.py | SimengSun/revisit-nplm | bbe1cdaecf1d7d104d27b1035a591ebbd3b5141e | [
"BSD-3-Clause"
] | 9 | 2021-04-09T21:48:39.000Z | 2022-02-14T15:25:22.000Z | data/text.py | SimengSun/revisit-nplm | bbe1cdaecf1d7d104d27b1035a591ebbd3b5141e | [
"BSD-3-Clause"
] | 1 | 2021-05-19T17:16:50.000Z | 2021-05-28T23:08:36.000Z | data/text.py | SimengSun/revisit-nplm | bbe1cdaecf1d7d104d27b1035a591ebbd3b5141e | [
"BSD-3-Clause"
] | 3 | 2021-06-10T04:21:36.000Z | 2022-01-16T11:17:10.000Z | """
Implement torch iterable dataset
- build vocab ordered by freq for
"""
from tqdm import tqdm
import torch
import torch.utils.data
from torch.utils.data.dataloader import DataLoader
import os
import sys
import pickle5 as pickle #import pickle
import math
from collections import defaultdict
SPLITS = ['train', 'v... | 29.534591 | 113 | 0.667376 | from tqdm import tqdm
import torch
import torch.utils.data
from torch.utils.data.dataloader import DataLoader
import os
import sys
import pickle5 as pickle import math
from collections import defaultdict
SPLITS = ['train', 'valid', 'test']
EOS = '<eos>'
PAD = '<pad>'
class Dataset(torch.utils.data.IterableDataset):
... | true | true |
f76aaf12645c3a969bd6ca5b63e4d6a78d4751ba | 14,820 | py | Python | backends/dpdk/run-dpdk-test.py | st22nestrel/p4c | 5285887bd4f6fcf6fd40b27e58291f647583f3b1 | [
"Apache-2.0"
] | null | null | null | backends/dpdk/run-dpdk-test.py | st22nestrel/p4c | 5285887bd4f6fcf6fd40b27e58291f647583f3b1 | [
"Apache-2.0"
] | 5 | 2022-02-11T09:23:13.000Z | 2022-03-29T12:03:35.000Z | backends/dpdk/run-dpdk-test.py | st22nestrel/p4c | 5285887bd4f6fcf6fd40b27e58291f647583f3b1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2013-present Barefoot Networks, 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 b... | 38.897638 | 152 | 0.591093 |
from os import environ
from threading import Timer
from subprocess import Popen,PIPE
from threading import Thread
import errno
import sys
import re
import os
import stat
import tempfile
import shutil
import difflib
import subprocess
import glob
SUCCESS = 0
FAILURE = 1
class Options(object):
def __init__(self):
... | true | true |
f76ab019a4fa68d10e48c8c9c703a2edf71da5e2 | 1,733 | py | Python | scripts/start.py | ReyRen/k8sMLer-client-go | 99a090ee4c94d6e2a1c3b161a18506192f82fb77 | [
"MIT"
] | 5 | 2020-09-18T01:12:49.000Z | 2021-12-14T06:57:07.000Z | scripts/start.py | ReyRen/k8sMLer-client-go | 99a090ee4c94d6e2a1c3b161a18506192f82fb77 | [
"MIT"
] | 11 | 2020-09-18T11:58:01.000Z | 2021-04-07T08:06:32.000Z | scripts/start.py | ReyRen/k8sMLer-client-go | 99a090ee4c94d6e2a1c3b161a18506192f82fb77 | [
"MIT"
] | null | null | null | import time
import os
import sys
import urllib
import urllib.request
print('Start')
sys.stdout.flush()
os.chdir('/usr/share/horovod')
def get_init():
ftp_flag = False
while not ftp_flag:
try:
urllib.request.urlretrieve('http://172.18.29.81/ftp/script/local_init.py', '/usr/share/horovod/loc... | 25.485294 | 138 | 0.586844 | import time
import os
import sys
import urllib
import urllib.request
print('Start')
sys.stdout.flush()
os.chdir('/usr/share/horovod')
def get_init():
ftp_flag = False
while not ftp_flag:
try:
urllib.request.urlretrieve('http://172.18.29.81/ftp/script/local_init.py', '/usr/share/horovod/loc... | true | true |
f76ab0c89916d02618e7aa0640cface66e5f1a28 | 40,462 | py | Python | test/functional/rpc_psbt.py | xaya/xaya | 2ded8ee56fe399b023a0ec7341c54b45f9d6691b | [
"MIT"
] | 96 | 2018-07-15T14:09:46.000Z | 2022-03-27T23:37:15.000Z | test/functional/rpc_psbt.py | xaya/xaya | 2ded8ee56fe399b023a0ec7341c54b45f9d6691b | [
"MIT"
] | 45 | 2018-07-13T13:53:19.000Z | 2022-01-12T09:09:26.000Z | test/functional/rpc_psbt.py | xaya/xaya | 2ded8ee56fe399b023a0ec7341c54b45f9d6691b | [
"MIT"
] | 47 | 2018-08-03T04:55:45.000Z | 2022-03-10T07:50:31.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from itertools import prod... | 61.120846 | 584 | 0.675127 |
from decimal import Decimal
from itertools import product
from test_framework.descriptors import descsum_create
from test_framework.key import ECKey
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_approx,
assert_equal,
assert_greater_than,
assert... | true | true |
f76ab315820c519614dd7e0e92f6e7037feb6dd9 | 10,240 | py | Python | brian2/sphinxext/briandoc.py | Debilski/brian2 | 560377aba16d8ddaba55fd50432b1142f6233f66 | [
"BSD-2-Clause"
] | null | null | null | brian2/sphinxext/briandoc.py | Debilski/brian2 | 560377aba16d8ddaba55fd50432b1142f6233f66 | [
"BSD-2-Clause"
] | null | null | null | brian2/sphinxext/briandoc.py | Debilski/brian2 | 560377aba16d8ddaba55fd50432b1142f6233f66 | [
"BSD-2-Clause"
] | null | null | null | """
========
briandoc
========
Sphinx extension that handles docstrings in the Numpy standard format with some
brian-specific tweaks. [1]
It will:
- Convert Parameters etc. sections to field lists.
- Convert See Also section to a See also entry.
- Renumber references.
- Extract the signature from the docstring, if i... | 36.702509 | 105 | 0.560449 | from __future__ import absolute_import
from past.builtins import unicode
import re
import pydoc
import inspect
from docutils import statemachine
from docutils.parsers.rst import directives, Directive
import sphinx
from sphinx.roles import XRefRole
from sphinx.domains.python import PyXRefRole
if sphinx.__version__ < '1... | true | true |
f76ab3c70b534dddc66b49a1725c011d83f3b504 | 1,947 | py | Python | -Publish-Superhero-Statistics/code.py | VarunNangalia/ga-learner-dsmp-repo | c7c1485e6745ba62e666cce7e2accf6eee30ed17 | [
"MIT"
] | null | null | null | -Publish-Superhero-Statistics/code.py | VarunNangalia/ga-learner-dsmp-repo | c7c1485e6745ba62e666cce7e2accf6eee30ed17 | [
"MIT"
] | null | null | null | -Publish-Superhero-Statistics/code.py | VarunNangalia/ga-learner-dsmp-repo | c7c1485e6745ba62e666cce7e2accf6eee30ed17 | [
"MIT"
] | null | null | null | # --------------
#Header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
#path of the data file- path
data = pd.read_csv(path)
#Code starts here
data['Gender'].replace('-','Agender',inplace=True)
gender_count = data['Gender'].value_counts()
gender_count.pl... | 25.285714 | 88 | 0.682589 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
data = pd.read_csv(path)
data['Gender'].replace('-','Agender',inplace=True)
gender_count = data['Gender'].value_counts()
gender_count.plot(kind='bar', title ="Gender",figsize=(15,10),legend=True, fontsize=12)
plt.show... | true | true |
f76ab43cf9e9ec123b786ed483870c75d65cf52b | 19,419 | py | Python | grr/parsers/windows_registry_parser.py | ethicalhackeragnidhra/Grr | 9ff9178396d9d16575e42dded33627cb09ac3af1 | [
"Apache-2.0"
] | 1 | 2020-12-18T00:47:19.000Z | 2020-12-18T00:47:19.000Z | grr/parsers/windows_registry_parser.py | ethicalhackeragnidhra/Grr | 9ff9178396d9d16575e42dded33627cb09ac3af1 | [
"Apache-2.0"
] | null | null | null | grr/parsers/windows_registry_parser.py | ethicalhackeragnidhra/Grr | 9ff9178396d9d16575e42dded33627cb09ac3af1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Simple parsers for registry keys and values."""
import os
import re
import logging
from grr.lib import artifact_utils
from grr.lib import parsers
from grr.lib import rdfvalue
from grr.lib import type_info
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
SID_RE = ... | 35.89464 | 80 | 0.649827 |
import os
import re
import logging
from grr.lib import artifact_utils
from grr.lib import parsers
from grr.lib import rdfvalue
from grr.lib import type_info
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
SID_RE = re.compile(r"^S-\d-\d+-(\d+-){1,14}\d+$")
class CurrentControlSetKBPars... | true | true |
f76ab644da7c5abf5b19845cf3717c2cad03a177 | 1,396 | py | Python | zerver/webhooks/dialogflow/view.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-03-17T14:58:50.000Z | 2020-03-17T14:58:50.000Z | zerver/webhooks/dialogflow/view.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 2 | 2020-09-07T22:32:24.000Z | 2021-05-08T18:17:53.000Z | zerver/webhooks/dialogflow/view.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-07-16T06:00:10.000Z | 2020-07-16T06:00:10.000Z | # Webhooks for external integrations.
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_private_message
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response impor... | 37.72973 | 82 | 0.686246 | from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.actions import check_send_private_message
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.models impo... | true | true |
f76ab6522e092ff231002237420ca8c808a09daa | 1,029 | py | Python | tests/Python/OWASP_a1/cwe_78/safe/cwe_78__I_hardcoded_string_input__F_no_filtering__S_ls__1-8.5_File1.py | usnistgov/VTSG | f4477a78ec19f7e9757da0321cb5a69428e358cf | [
"MIT"
] | null | null | null | tests/Python/OWASP_a1/cwe_78/safe/cwe_78__I_hardcoded_string_input__F_no_filtering__S_ls__1-8.5_File1.py | usnistgov/VTSG | f4477a78ec19f7e9757da0321cb5a69428e358cf | [
"MIT"
] | 1 | 2022-01-31T22:22:55.000Z | 2022-01-31T22:22:55.000Z | tests/Python/OWASP_a1/cwe_78/safe/cwe_78__I_hardcoded_string_input__F_no_filtering__S_ls__1-8.5_File1.py | usnistgov/VTSG | f4477a78ec19f7e9757da0321cb5a69428e358cf | [
"MIT"
] | null | null | null |
'''
Hardcoded string input
no filtering
sink: run ls in a dir
'''
'''
Created by Paul E. Black and William Mentzer 2020
This software was developed at the National Institute of Standards and Technology
by employees of the Federal Government in the course of their official duties.
Pursuant to title 17 Section 105 of t... | 21.893617 | 81 | 0.641399 |
'''
Hardcoded string input
no filtering
sink: run ls in a dir
'''
'''
Created by Paul E. Black and William Mentzer 2020
This software was developed at the National Institute of Standards and Technology
by employees of the Federal Government in the course of their official duties.
Pursuant to title 17 Section 105 of t... | false | true |
f76ab7314c2e3fd1b4f7c2aca44ed3ad9d973c28 | 7,335 | py | Python | ansible/modules/hashivault/hashivault_write.py | vovka667/ansible-modules-hashivault | 6050e676357669984f50c9b62389f046125c089c | [
"MIT"
] | null | null | null | ansible/modules/hashivault/hashivault_write.py | vovka667/ansible-modules-hashivault | 6050e676357669984f50c9b62389f046125c089c | [
"MIT"
] | null | null | null | ansible/modules/hashivault/hashivault_write.py | vovka667/ansible-modules-hashivault | 6050e676357669984f50c9b62389f046125c089c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import warnings
import hvac
from ansible.module_utils.hashivault import hashivault_argspec
from ansible.module_utils.hashivault import hashivault_auth_client
from ansible.module_utils.hashivault import hashivault_init
from ansible.module_utils.hashivault import hashiwrapper
ANSIBLE_METADATA = {... | 33.646789 | 167 | 0.592093 | import warnings
import hvac
from ansible.module_utils.hashivault import hashivault_argspec
from ansible.module_utils.hashivault import hashivault_auth_client
from ansible.module_utils.hashivault import hashivault_init
from ansible.module_utils.hashivault import hashiwrapper
ANSIBLE_METADATA = {'status': ['stableinte... | true | true |
f76ab79ec0fe3e1180ac00ed927da83d0384feaf | 2,468 | py | Python | common/xrd-ui-tests-python/tests/xroad_configure_service_222/XroadAddWsdlSecurityServerClient.py | nordic-institute/X-Road-tests | e030661a0ad8ceab74dd8122b751e88025a3474a | [
"MIT"
] | 1 | 2019-02-09T00:16:54.000Z | 2019-02-09T00:16:54.000Z | common/xrd-ui-tests-python/tests/xroad_configure_service_222/XroadAddWsdlSecurityServerClient.py | nordic-institute/X-Road-tests | e030661a0ad8ceab74dd8122b751e88025a3474a | [
"MIT"
] | 1 | 2018-06-06T08:33:32.000Z | 2018-06-06T08:33:32.000Z | common/xrd-ui-tests-python/tests/xroad_configure_service_222/XroadAddWsdlSecurityServerClient.py | nordic-institute/X-Road-tests | e030661a0ad8ceab74dd8122b751e88025a3474a | [
"MIT"
] | 3 | 2018-07-09T08:51:00.000Z | 2020-07-23T18:40:24.000Z | # coding=utf-8
import unittest
from helpers import xroad
from main.maincontroller import MainController
from tests.xroad_configure_service_222 import configure_add_wsdl
class XroadAddWsdlSecurityServerClient(unittest.TestCase):
"""
UC SERVICE_08: Add a WSDL to a Security Server Client
RIA URL: https://ji... | 41.133333 | 100 | 0.579417 | import unittest
from helpers import xroad
from main.maincontroller import MainController
from tests.xroad_configure_service_222 import configure_add_wsdl
class XroadAddWsdlSecurityServerClient(unittest.TestCase):
def __init__(self, methodName='test_xroad_configure_service'):
unittest.TestCase.__init__(se... | true | true |
f76ab7b35f20c3d2c61e245d4553efde7c5d2b3c | 6,128 | py | Python | gaphor/ui/tests/test_handletool.py | albanobattistella/gaphor | 5fc6b0ff39ba6dbbb73cb9b111f32d1eda790e14 | [
"Apache-2.0"
] | null | null | null | gaphor/ui/tests/test_handletool.py | albanobattistella/gaphor | 5fc6b0ff39ba6dbbb73cb9b111f32d1eda790e14 | [
"Apache-2.0"
] | null | null | null | gaphor/ui/tests/test_handletool.py | albanobattistella/gaphor | 5fc6b0ff39ba6dbbb73cb9b111f32d1eda790e14 | [
"Apache-2.0"
] | null | null | null | """
Test handle tool functionality.
"""
import pytest
from gaphas.aspect import ConnectionSink
from gaphas.aspect import Connector as ConnectorAspect
from gi.repository import Gdk, Gtk
from gaphor import UML
from gaphor.application import Session
from gaphor.diagram.connectors import Connector
from gaphor.diagram.dia... | 28.90566 | 87 | 0.721443 |
import pytest
from gaphas.aspect import ConnectionSink
from gaphas.aspect import Connector as ConnectorAspect
from gi.repository import Gdk, Gtk
from gaphor import UML
from gaphor.application import Session
from gaphor.diagram.connectors import Connector
from gaphor.diagram.diagramtools import ConnectHandleTool, Diag... | true | true |
f76ab91eca864e5bc91d2aafec53f22eaf880334 | 21,108 | py | Python | .venv/lib/python2.7/site-packages/ansible/module_utils/vmware.py | Achraf-Ben/Ansible- | a271b4c32948a7f8726e3f3174e12fe6ff491619 | [
"MIT"
] | null | null | null | .venv/lib/python2.7/site-packages/ansible/module_utils/vmware.py | Achraf-Ben/Ansible- | a271b4c32948a7f8726e3f3174e12fe6ff491619 | [
"MIT"
] | null | null | null | .venv/lib/python2.7/site-packages/ansible/module_utils/vmware.py | Achraf-Ben/Ansible- | a271b4c32948a7f8726e3f3174e12fe6ff491619 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | 32.878505 | 138 | 0.6408 |
import atexit
import os
import ssl
import time
try:
import requests
from pyVim import connect
from pyVmomi import vim
HAS_PYVMOMI = True
except ImportError:
HAS_PYVMOMI = False
from ansible.module_utils.urls import fetch_url
from ansible.module_utils.six import integer_types, iteritems, stri... | true | true |
f76ab9fc2a1f6a91e5bdbfbaa184ffe4a3df1c8a | 823 | py | Python | setup.py | kinow-io/kinow-python-sdk | 4c1699a3c78048b84287bd049a669651a5b4e2d5 | [
"Apache-2.0"
] | 1 | 2019-06-26T14:24:54.000Z | 2019-06-26T14:24:54.000Z | setup.py | kinow-io/kinow-python-sdk | 4c1699a3c78048b84287bd049a669651a5b4e2d5 | [
"Apache-2.0"
] | null | null | null | setup.py | kinow-io/kinow-python-sdk | 4c1699a3c78048b84287bd049a669651a5b4e2d5 | [
"Apache-2.0"
] | 1 | 2018-02-01T10:08:40.000Z | 2018-02-01T10:08:40.000Z | # coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 1.4.58
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import sys
from setuptools import setup, find_packages
NAME = "kinow_client"
VERSION = "1.0.0"
# To install the library, run th... | 19.595238 | 75 | 0.664642 |
import sys
from setuptools import setup, find_packages
NAME = "kinow_client"
VERSION = "1.0.0"
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
setup(
name=NAME,
version=VERSION,
description="Server API",
author_email="",
url="",
keywords=["Swagger", "Server API"... | true | true |
f76aba2407c50699ac13a302cbf8c6bb5b972bfc | 30 | py | Python | python/test_rel_import/package1/module1a.py | galdebert/sandbox | 1489ed6dfe0b7e44fbc4dc71942bf1d5377a9de9 | [
"Apache-2.0"
] | 1 | 2015-09-15T21:41:57.000Z | 2015-09-15T21:41:57.000Z | python/test_rel_import/package1/module1a.py | autodefrost/sandbox | 1489ed6dfe0b7e44fbc4dc71942bf1d5377a9de9 | [
"Apache-2.0"
] | null | null | null | python/test_rel_import/package1/module1a.py | autodefrost/sandbox | 1489ed6dfe0b7e44fbc4dc71942bf1d5377a9de9 | [
"Apache-2.0"
] | null | null | null | def func1a():
print('1a')
| 10 | 15 | 0.533333 | def func1a():
print('1a')
| true | true |
f76aba40a7c88e8c2f8c32ccf347d9e052bcebf5 | 3,138 | py | Python | hw/hw5/24/main.py | makci97/bio_algo | 16481ab91fbf343aee1747bc6b01d281baec462d | [
"MIT"
] | null | null | null | hw/hw5/24/main.py | makci97/bio_algo | 16481ab91fbf343aee1747bc6b01d281baec462d | [
"MIT"
] | null | null | null | hw/hw5/24/main.py | makci97/bio_algo | 16481ab91fbf343aee1747bc6b01d281baec462d | [
"MIT"
] | null | null | null | import sys
import numpy as np
from enum import Enum
from functools import lru_cache
from collections import Counter, defaultdict
class Move(Enum):
none = 0
down = 1
right = 2
diag = 3
from_start = 4
to_end = 5
def longest_path(word1, word2, weights, sigma):
n, m = len(word1), len(word2)... | 29.327103 | 89 | 0.513384 | import sys
import numpy as np
from enum import Enum
from functools import lru_cache
from collections import Counter, defaultdict
class Move(Enum):
none = 0
down = 1
right = 2
diag = 3
from_start = 4
to_end = 5
def longest_path(word1, word2, weights, sigma):
n, m = len(word1), len(word2)... | true | true |
f76abab72afd1fa7dc9178de07c9e82afad9dcc0 | 1,842 | py | Python | tests/journal.ext/warning_properties.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/journal.ext/warning_properties.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/journal.ext/warning_properties.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
# (c) 1998-2022 all rights reserved
def test():
"""
Verify access to the channel properties
"""
# access
from journal import libjournal
# make a warning channel
channel = libjournal.War... | 24.236842 | 78 | 0.648751 |
def test():
from journal import libjournal
channel = libjournal.Warning("test.channel")
assert channel.name == "test.channel"
try:
channel.name = "foo"
assert False, "unreachable"
# if all goes well
except AttributeError as error:
# no ... | true | true |
f76abb04fc89703a44af4d6f387b0ce273c1aec4 | 10,407 | py | Python | zerver/webhooks/jira/view.py | zhoufeng1989/zulip | 74143a0801f76051ae30e8037b62205ffc4ccc61 | [
"Apache-2.0"
] | 1 | 2019-03-23T05:05:46.000Z | 2019-03-23T05:05:46.000Z | zerver/webhooks/jira/view.py | zhoufeng1989/zulip | 74143a0801f76051ae30e8037b62205ffc4ccc61 | [
"Apache-2.0"
] | 2 | 2019-03-21T08:13:34.000Z | 2019-04-01T13:08:11.000Z | zerver/webhooks/jira/view.py | zhoufeng1989/zulip | 74143a0801f76051ae30e8037b62205ffc4ccc61 | [
"Apache-2.0"
] | null | null | null | # Webhooks for external integrations.
import re
from typing import Any, Dict, List, Optional
from django.db.models import Q
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import... | 40.181467 | 102 | 0.643125 | import re
from typing import Any, Dict, List, Optional
from django.db.models import Q
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks... | true | true |
f76abcb519c57fb255d9b3d62c81f89399515b87 | 2,452 | py | Python | nltkma/parse/generate.py | aydtmiri/nltk-ma | 5d7dd01844ee063fc910a648948624b6a2dddaf9 | [
"Apache-2.0"
] | null | null | null | nltkma/parse/generate.py | aydtmiri/nltk-ma | 5d7dd01844ee063fc910a648948624b6a2dddaf9 | [
"Apache-2.0"
] | null | null | null | nltkma/parse/generate.py | aydtmiri/nltk-ma | 5d7dd01844ee063fc910a648948624b6a2dddaf9 | [
"Apache-2.0"
] | null | null | null | # Natural Language Toolkit: Generating from a CFG
#
# Copyright (C) 2001-2021 NLTK Project
# Author: Steven Bird <stevenbird1@gmail.com>
# Peter Ljunglöf <peter.ljunglof@heatherleaf.se>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
#
import itertools
import sys
from nltkma.grammar import... | 27.550562 | 80 | 0.603997 |
import itertools
import sys
from nltkma.grammar import Nonterminal
def generate(grammar, start=None, depth=None, n=None):
if not start:
start = grammar.start()
if depth is None:
depth = sys.maxsize
iter = _generate_all(grammar, [start], depth)
if n:
iter = itertools.islice(i... | true | true |
f76abd9f8942e66a5c0a15fd628547384a5c988f | 31,752 | py | Python | sympy/polys/numberfields.py | pbrady/sympy | 7163137e22fbefbb645147a15147b26dad220d49 | [
"BSD-3-Clause"
] | 1 | 2019-06-27T13:40:28.000Z | 2019-06-27T13:40:28.000Z | sympy/polys/numberfields.py | amitsaha/sympy | 43ddfc644fd604a3dc0d4cac0aebfecd051917c1 | [
"BSD-3-Clause"
] | null | null | null | sympy/polys/numberfields.py | amitsaha/sympy | 43ddfc644fd604a3dc0d4cac0aebfecd051917c1 | [
"BSD-3-Clause"
] | null | null | null | """Computational algebraic field theory. """
from __future__ import print_function, division
from sympy import (
S, Rational, AlgebraicNumber,
Add, Mul, sympify, Dummy, expand_mul, I, pi
)
from sympy.functions.elementary.exponential import exp
from sympy.functions.elementary.trigonometric import cos, sin
fr... | 28.553957 | 97 | 0.539273 |
from __future__ import print_function, division
from sympy import (
S, Rational, AlgebraicNumber,
Add, Mul, sympify, Dummy, expand_mul, I, pi
)
from sympy.functions.elementary.exponential import exp
from sympy.functions.elementary.trigonometric import cos, sin
from sympy.polys.polytools import (
Poly, P... | true | true |
f76abe448fa33bb3dc6a52503b089ed729f5bfc1 | 41,050 | py | Python | pytype/matcher.py | dlax/pytype | e3a41fb38517a1969be7582e7e93c59d674f2f50 | [
"Apache-2.0"
] | null | null | null | pytype/matcher.py | dlax/pytype | e3a41fb38517a1969be7582e7e93c59d674f2f50 | [
"Apache-2.0"
] | null | null | null | pytype/matcher.py | dlax/pytype | e3a41fb38517a1969be7582e7e93c59d674f2f50 | [
"Apache-2.0"
] | null | null | null | """Matching logic for abstract values."""
import collections
import contextlib
import logging
from pytype import abstract
from pytype import abstract_utils
from pytype import compat
from pytype import datatypes
from pytype import function
from pytype import mixin
from pytype import special_builtins
from pytype import ... | 43.810032 | 80 | 0.676127 | import collections
import contextlib
import logging
from pytype import abstract
from pytype import abstract_utils
from pytype import compat
from pytype import datatypes
from pytype import function
from pytype import mixin
from pytype import special_builtins
from pytype import utils
from pytype.overlays import typing_o... | true | true |
f76abe95f40895786a4695f9382be2c7d61f76cc | 6,186 | py | Python | design/trackplan/trackplan.py | ParikhKadam/cycloid | c5e64e8379f801417a38755eb6b2fde881dabd8c | [
"MIT"
] | 156 | 2017-08-12T03:58:21.000Z | 2022-03-21T13:38:52.000Z | design/trackplan/trackplan.py | ParikhKadam/cycloid | c5e64e8379f801417a38755eb6b2fde881dabd8c | [
"MIT"
] | 3 | 2018-12-11T11:31:06.000Z | 2019-12-05T18:43:51.000Z | design/trackplan/trackplan.py | ParikhKadam/cycloid | c5e64e8379f801417a38755eb6b2fde881dabd8c | [
"MIT"
] | 18 | 2017-08-17T02:05:54.000Z | 2022-02-24T20:54:27.000Z | # racetrack route planner
# based on apex cone locations and track widths, get a
import numpy as np
maxv = 10
laterala = 8
maxk = 1.5
bw_v = np.pi*2*0.7
bw_w = np.pi*2*1.5
# track is a set of points and radii (positive or negative if track goes CCW/CW
# around each point)
# so first we determine the nearest point
... | 26.895652 | 86 | 0.479146 | import numpy as np
maxv = 10
laterala = 8
maxk = 1.5
bw_v = np.pi*2*0.7
bw_w = np.pi*2*1.5
def gettargetv(k):
kmin = laterala / (maxv**2)
targetv = maxv
if np.abs(k) > kmin:
targetv = np.sqrt(laterala / np.abs(k))
return targetv
def gettrack(xy, T):
Tn = np.hstack([T[:, 1:], T[:, :1]... | true | true |
f76abedaa21e5414a122a081740c1f48c5237dd5 | 421 | py | Python | heroctf-v3/win-but-twisted/exploit.py | onealmond/hacking-lab | 631e615944add02db3c2afef47bf1de7171eb065 | [
"MIT"
] | 9 | 2021-04-20T15:28:36.000Z | 2022-03-08T19:53:48.000Z | heroctf-v3/win-but-twisted/exploit.py | onealmond/hacking-lab | 631e615944add02db3c2afef47bf1de7171eb065 | [
"MIT"
] | null | null | null | heroctf-v3/win-but-twisted/exploit.py | onealmond/hacking-lab | 631e615944add02db3c2afef47bf1de7171eb065 | [
"MIT"
] | 6 | 2021-06-24T03:25:21.000Z | 2022-02-20T21:44:52.000Z | #!/usr/bin/env python3
import pwn
host = "pwn.heroctf.fr"
port = 9003
target = "WinButTwisted"
def exploit():
pr = pwn.connect(host, port)
elf = pwn.ELF(target)
rop = pwn.ROP(elf)
payload = b"A" * 32
rop.set_lock()
rop.shell()
payload += rop.chain()
print('len:', len(payload), payload... | 19.136364 | 62 | 0.610451 | import pwn
host = "pwn.heroctf.fr"
port = 9003
target = "WinButTwisted"
def exploit():
pr = pwn.connect(host, port)
elf = pwn.ELF(target)
rop = pwn.ROP(elf)
payload = b"A" * 32
rop.set_lock()
rop.shell()
payload += rop.chain()
print('len:', len(payload), payload)
pr.sendlineafter(... | true | true |
f76ac07c3121ba796fc035d803970fd7a9a319af | 4,627 | py | Python | lib/python/flame/examples/mnist/aggregator/pytorch/main.py | GaoxiangLuo/flame | 16bd1715a545421d45ea0fc32544e448389de49c | [
"Apache-2.0"
] | 6 | 2022-03-30T23:37:05.000Z | 2022-03-31T17:29:14.000Z | lib/python/flame/examples/mnist/aggregator/pytorch/main.py | GaoxiangLuo/flame | 16bd1715a545421d45ea0fc32544e448389de49c | [
"Apache-2.0"
] | 10 | 2022-03-31T00:03:58.000Z | 2022-03-31T07:15:06.000Z | lib/python/flame/examples/mnist/aggregator/pytorch/main.py | GaoxiangLuo/flame | 16bd1715a545421d45ea0fc32544e448389de49c | [
"Apache-2.0"
] | 2 | 2022-03-30T23:25:15.000Z | 2022-03-30T23:55:47.000Z | # Copyright 2022 Cisco Systems, Inc. and its affiliates
#
# 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 l... | 30.642384 | 77 | 0.597579 |
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from flame.config import Config
from flame.dataset import Dataset
from flame.mode.horizontal.top_aggregator import TopAggregator
from torchvision import datasets, transforms
logger = logging.getLogger(__name__)
class Net(nn.Module):
... | true | true |
f76ac08cf5e534065efc78b4b316df8bd7d93205 | 996 | py | Python | pyrep/sensors/accelerometer.py | WeiWeic6222848/PyRep | 231a1ac6b0a179cff53c1d403d379260b9f05f2f | [
"MIT"
] | 505 | 2019-06-26T17:02:44.000Z | 2022-03-31T04:03:23.000Z | pyrep/sensors/accelerometer.py | WeiWeic6222848/PyRep | 231a1ac6b0a179cff53c1d403d379260b9f05f2f | [
"MIT"
] | 255 | 2019-06-27T07:04:17.000Z | 2022-03-29T18:25:48.000Z | pyrep/sensors/accelerometer.py | WeiWeic6222848/PyRep | 231a1ac6b0a179cff53c1d403d379260b9f05f2f | [
"MIT"
] | 171 | 2019-06-27T05:33:50.000Z | 2022-03-30T03:34:24.000Z | from typing import List
from pyrep.backend import sim
from pyrep.const import ObjectType
from pyrep.objects.force_sensor import ForceSensor
from pyrep.objects.object import Object
from pyrep.objects.shape import Shape
class Accelerometer(Object):
"""An object able to measure accelerations that are applied to it.... | 32.129032 | 74 | 0.683735 | from typing import List
from pyrep.backend import sim
from pyrep.const import ObjectType
from pyrep.objects.force_sensor import ForceSensor
from pyrep.objects.object import Object
from pyrep.objects.shape import Shape
class Accelerometer(Object):
def __init__(self, name):
super().__init__(name)
... | true | true |
f76ac0afef1a8a05ef05e232c26f552917b5e034 | 3,112 | py | Python | ambari-server/src/main/resources/stacks/ODP/1.0/services/KAFKA/package/scripts/upgrade.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/ODP/1.0/services/KAFKA/package/scripts/upgrade.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/ODP/1.0/services/KAFKA/package/scripts/upgrade.py | zyclove/ambari | 1032f0f54cb7b312b9a3b37570cd840f4e1e89d4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); yo... | 41.493333 | 141 | 0.762532 | import os
from resource_management.core.resources.system import Execute
from resource_management.libraries.functions import format
from resource_management.libraries.functions import Direction
from resource_management.core.exceptions import Fail
from resource_management.core.logger import Logger
def run_migration(en... | true | true |
f76ac0e8ed8e39d44031812ea4fc42d3e3b4a9b6 | 229 | py | Python | gera_senha/rd.py | Felipe-007/Python | 6e7bd432d578ec5ce43b926bfcd3b396c82749c4 | [
"MIT"
] | null | null | null | gera_senha/rd.py | Felipe-007/Python | 6e7bd432d578ec5ce43b926bfcd3b396c82749c4 | [
"MIT"
] | null | null | null | gera_senha/rd.py | Felipe-007/Python | 6e7bd432d578ec5ce43b926bfcd3b396c82749c4 | [
"MIT"
] | null | null | null | import random
import string
# Gera senha aleatória
letras = string.ascii_letters
digitos = string.digits
caracteres = '!@#$%&*._-'
geral = letras + digitos + caracteres
senha = "".join(random.choices(geral, k=20))
print(senha)
| 19.083333 | 44 | 0.720524 | import random
import string
letras = string.ascii_letters
digitos = string.digits
caracteres = '!@#$%&*._-'
geral = letras + digitos + caracteres
senha = "".join(random.choices(geral, k=20))
print(senha)
| true | true |
f76ac1e3148f77cf67dbe0964262aab6ca32591b | 4,182 | py | Python | LostParser.py | pooi/Lost112Parser | 31ba3ffbd26def15232bec270ca7afecf26b5b97 | [
"Apache-2.0"
] | null | null | null | LostParser.py | pooi/Lost112Parser | 31ba3ffbd26def15232bec270ca7afecf26b5b97 | [
"Apache-2.0"
] | null | null | null | LostParser.py | pooi/Lost112Parser | 31ba3ffbd26def15232bec270ca7afecf26b5b97 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# pip3 install xlsxwriter
# pip3 install selenium
try:
import urllib.request as urllib2
except ImportError:
import urllib2
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_... | 27.513158 | 93 | 0.56791 |
try:
import urllib.request as urllib2
except ImportError:
import urllib2
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
... | true | true |
f76ac1ef776e7490d5682dc4483190308bcd0e1b | 7,181 | py | Python | clrnet/datasets/llamas.py | Turoad/CLRNet | 51e082db12973943bddefd76fd0d431fcb3350ff | [
"Apache-2.0"
] | 18 | 2022-03-16T07:29:19.000Z | 2022-03-31T07:05:37.000Z | clrnet/datasets/llamas.py | Turoad/CLRNet | 51e082db12973943bddefd76fd0d431fcb3350ff | [
"Apache-2.0"
] | 1 | 2022-03-16T11:47:13.000Z | 2022-03-17T10:15:25.000Z | clrnet/datasets/llamas.py | Turoad/CLRNet | 51e082db12973943bddefd76fd0d431fcb3350ff | [
"Apache-2.0"
] | 1 | 2022-03-25T14:49:58.000Z | 2022-03-25T14:49:58.000Z | import os
import pickle as pkl
import cv2
from .registry import DATASETS
import numpy as np
from tqdm import tqdm
from .base_dataset import BaseDataset
TRAIN_LABELS_DIR = 'labels/train'
TEST_LABELS_DIR = 'labels/valid'
TEST_IMGS_DIR = 'color_images/test'
SPLIT_DIRECTORIES = {'train': 'labels/train', 'val': 'labels/va... | 39.674033 | 90 | 0.536276 | import os
import pickle as pkl
import cv2
from .registry import DATASETS
import numpy as np
from tqdm import tqdm
from .base_dataset import BaseDataset
TRAIN_LABELS_DIR = 'labels/train'
TEST_LABELS_DIR = 'labels/valid'
TEST_IMGS_DIR = 'color_images/test'
SPLIT_DIRECTORIES = {'train': 'labels/train', 'val': 'labels/va... | true | true |
f76ac4d1f7421a1c20bfd3d86eb003b2c3ceac30 | 1,604 | py | Python | examples/a3c_breakout/main.py | Ravie403/chainerrl-visualizer | 302bcd574d435ab68652b084764d4bb777300494 | [
"MIT"
] | 45 | 2018-12-13T07:18:43.000Z | 2022-03-26T15:37:27.000Z | examples/a3c_breakout/main.py | Ravie403/chainerrl-visualizer | 302bcd574d435ab68652b084764d4bb777300494 | [
"MIT"
] | 12 | 2018-12-13T10:46:23.000Z | 2021-03-08T23:39:56.000Z | examples/a3c_breakout/main.py | Ravie403/chainerrl-visualizer | 302bcd574d435ab68652b084764d4bb777300494 | [
"MIT"
] | 10 | 2018-12-13T07:20:20.000Z | 2021-12-11T14:07:56.000Z | import chainer
import numpy as np
from chainerrl.agents import a3c
from chainerrl import links
from chainerrl import misc
from chainerrl.optimizers import rmsprop_async
from chainerrl import policy
from chainerrl import v_function
from chainerrl.wrappers import atari_wrappers
from chainerrl_visualizer import launch_v... | 23.246377 | 68 | 0.707606 | import chainer
import numpy as np
from chainerrl.agents import a3c
from chainerrl import links
from chainerrl import misc
from chainerrl.optimizers import rmsprop_async
from chainerrl import policy
from chainerrl import v_function
from chainerrl.wrappers import atari_wrappers
from chainerrl_visualizer import launch_v... | true | true |
f76ac4dafd00f0c8d75f3ea4cc2ffb9e396b4e26 | 900 | py | Python | hard-gists/7ceb3e7ef239e282a9d2/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 21 | 2019-07-08T08:26:45.000Z | 2022-01-24T23:53:25.000Z | hard-gists/7ceb3e7ef239e282a9d2/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 5 | 2019-06-15T14:47:47.000Z | 2022-02-26T05:02:56.000Z | hard-gists/7ceb3e7ef239e282a9d2/snippet.py | jjhenkel/dockerizeme | eaa4fe5366f6b9adf74399eab01c712cacaeb279 | [
"Apache-2.0"
] | 17 | 2019-05-16T03:50:34.000Z | 2021-01-14T14:35:12.000Z | #!/usr/bin/env python
from __future__ import print_function
from datetime import datetime
from subprocess import call
from mercury206 import commands, communications, config
def update_rrd(path, values):
value = ':'.join(['N'] + map(str, values))
call(['rrdtool', 'update', path, value])
print("Updated"... | 24.324324 | 65 | 0.687778 | from __future__ import print_function
from datetime import datetime
from subprocess import call
from mercury206 import commands, communications, config
def update_rrd(path, values):
value = ':'.join(['N'] + map(str, values))
call(['rrdtool', 'update', path, value])
print("Updated", path)
def add_read... | true | true |
f76ac6fe581133d61f7bf9689df840b3d49fd548 | 452 | py | Python | competitive/AtCoder/ABC200/C.py | pn11/benkyokai | 9ebdc46b529e76b7196add26dbc1e62ad48e72b0 | [
"MIT"
] | null | null | null | competitive/AtCoder/ABC200/C.py | pn11/benkyokai | 9ebdc46b529e76b7196add26dbc1e62ad48e72b0 | [
"MIT"
] | 22 | 2020-03-24T16:24:47.000Z | 2022-02-26T15:51:18.000Z | competitive/AtCoder/ABC200/C.py | pn11/benkyokai | 9ebdc46b529e76b7196add26dbc1e62ad48e72b0 | [
"MIT"
] | null | null | null | import io
import re
import sys
from itertools import combinations
import numpy as np
from math import factorial
_INPUT_ = """\
8
199 100 200 400 300 500 600 200
"""
#sys.stdin = io.StringIO(_INPUT_)
N = int(input())
AA = [0 for _ in range(200)]
#print(AA)
for x in input().split():
AA[int(x) % 200] += 1
#A = np.arr... | 16.142857 | 54 | 0.634956 | import io
import re
import sys
from itertools import combinations
import numpy as np
from math import factorial
_INPUT_ = """\
8
199 100 200 400 300 500 600 200
"""
N = int(input())
AA = [0 for _ in range(200)]
for x in input().split():
AA[int(x) % 200] += 1
ans = 0
for c in AA:
ans += c*(c-1) // 2
print(an... | true | true |
f76ac870760c00c97b3f7a9de54ec878b903ccca | 407 | py | Python | budgets_project/wsgi.py | paulwilliamsen/budget | 2f270dc61601a629c61eb26d1d8c69d4ec86621f | [
"MIT"
] | null | null | null | budgets_project/wsgi.py | paulwilliamsen/budget | 2f270dc61601a629c61eb26d1d8c69d4ec86621f | [
"MIT"
] | null | null | null | budgets_project/wsgi.py | paulwilliamsen/budget | 2f270dc61601a629c61eb26d1d8c69d4ec86621f | [
"MIT"
] | null | null | null | """
WSGI config for budgets_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJAN... | 23.941176 | 78 | 0.793612 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'budgets_project.settings')
application = get_wsgi_application()
| true | true |
f76ac8ba7858b5d752d26dee75bf90951de39bab | 581 | py | Python | setup.py | MenEnger/autokeras | 8d96979c49623f7bb56f053ed5d47b3b81f498c0 | [
"MIT"
] | 1 | 2018-08-06T03:57:51.000Z | 2018-08-06T03:57:51.000Z | setup.py | MenEnger/autokeras | 8d96979c49623f7bb56f053ed5d47b3b81f498c0 | [
"MIT"
] | null | null | null | setup.py | MenEnger/autokeras | 8d96979c49623f7bb56f053ed5d47b3b81f498c0 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='autokeras',
packages=['autokeras'], # this must be the same as the name above
install_requires=['torch==0.4.0', 'torchvision==0.2.1', 'numpy==1.14.5', 'keras', 'scikit-learn==0.19.1', 'tensorflow'],
version='0.2.0',
description='Automated Machine Learn... | 36.3125 | 124 | 0.667814 | from distutils.core import setup
setup(
name='autokeras',
packages=['autokeras'], install_requires=['torch==0.4.0', 'torchvision==0.2.1', 'numpy==1.14.5', 'keras', 'scikit-learn==0.19.1', 'tensorflow'],
version='0.2.0',
description='Automated Machine Learning with Keras',
author='Haifeng Jin',... | true | true |
f76ac95e18c36d4008f4e103c5e2213ed8b49e53 | 1,025 | py | Python | multidevice_netmiko.py | bhsnsrma/Cisco_Python | e92e272d8335f6b7fef27466a085430dd1694396 | [
"Apache-2.0"
] | null | null | null | multidevice_netmiko.py | bhsnsrma/Cisco_Python | e92e272d8335f6b7fef27466a085430dd1694396 | [
"Apache-2.0"
] | null | null | null | multidevice_netmiko.py | bhsnsrma/Cisco_Python | e92e272d8335f6b7fef27466a085430dd1694396 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import netmiko
#multi vendor liberary
device1={
'username' : 'root',
'password' : 'cisco',
'device_type' : 'cisco_ios',
'host' : '192.168.176.128'
}
device2={
'username' : 'root',
'password' : 'cisco',
'device_type' : 'cisco_ios',
... | 25.625 | 102 | 0.510244 |
import netmiko
device1={
'username' : 'root',
'password' : 'cisco',
'device_type' : 'cisco_ios',
'host' : '192.168.176.128'
}
device2={
'username' : 'root',
'password' : 'cisco',
'device_type' : 'cisco_ios',
'host' : '192.168.176.128'
}... | true | true |
f76ac9d7bb5981066d40f2ac05e8803a3557a7f2 | 2,237 | py | Python | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/mslib.py | nawien-sharma/keyczar | c55563bbd70f4b6fefc7444e296aab9894475f9a | [
"Apache-2.0"
] | 30 | 2015-01-29T14:06:05.000Z | 2022-01-10T07:47:29.000Z | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/mslib.py | nawien-sharma/keyczar | c55563bbd70f4b6fefc7444e296aab9894475f9a | [
"Apache-2.0"
] | 1 | 2017-02-20T20:57:48.000Z | 2018-12-19T23:44:38.000Z | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/mslib.py | nawien-sharma/keyczar | c55563bbd70f4b6fefc7444e296aab9894475f9a | [
"Apache-2.0"
] | 15 | 2015-04-23T02:38:36.000Z | 2021-03-01T20:09:39.000Z | """SCons.Tool.mslib
Tool-specific initialization for lib (MicroSoft library archiver).
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 T... | 34.415385 | 89 | 0.73983 |
__revision__ = "src/engine/SCons/Tool/mslib.py 4043 2009/02/23 09:06:45 scons"
import SCons.Defaults
import SCons.Tool
import SCons.Tool.msvs
import SCons.Tool.msvc
import SCons.Util
from MSCommon import detect_msvs, merge_default_version
def generate(env):
SCons.Tool.createStaticLibBuilder(env)
merge... | true | true |
f76acb8beb8fdad223d7251af7bb8775f2c0e333 | 1,189 | py | Python | tests/vtk_ui/test_vtk_ui_set_font.py | scottwittenburg/vcs | 5b9f17fb78f7ab186fc0132ab81ada043a7ba348 | [
"BSD-3-Clause"
] | 11 | 2018-10-10T03:14:33.000Z | 2022-01-05T14:18:15.000Z | tests/vtk_ui/test_vtk_ui_set_font.py | scottwittenburg/vcs | 5b9f17fb78f7ab186fc0132ab81ada043a7ba348 | [
"BSD-3-Clause"
] | 196 | 2018-03-21T19:44:56.000Z | 2021-12-21T21:56:24.000Z | tests/vtk_ui/test_vtk_ui_set_font.py | scottwittenburg/vcs | 5b9f17fb78f7ab186fc0132ab81ada043a7ba348 | [
"BSD-3-Clause"
] | 5 | 2019-12-09T21:54:45.000Z | 2022-03-20T04:22:14.000Z | """
Test the __set_font function in the text module
"""
from vcs.vtk_ui.text import __set_font as set_font
import vtk
import os
from vtk_ui_test import vtk_ui_test
class test_vtk_ui_set_font(vtk_ui_test):
def do(self):
prop = vtk.vtkTextProperty()
set_font("Arial", prop)
if prop.GetFontF... | 25.297872 | 53 | 0.584525 | """
Test the __set_font function in the text module
"""
from vcs.vtk_ui.text import __set_font as set_font
import vtk
import os
from vtk_ui_test import vtk_ui_test
class test_vtk_ui_set_font(vtk_ui_test):
def do(self):
prop = vtk.vtkTextProperty()
set_font("Arial", prop)
if prop.GetFontF... | false | true |
f76acc543065a08943b7ac1869488170fb82d85c | 3,921 | py | Python | src/restfw/config/external_links.py | Cykooz/restfw | d94db685aa0dcda2eaf3eba24c4a29d5c3eb84e4 | [
"MIT"
] | null | null | null | src/restfw/config/external_links.py | Cykooz/restfw | d94db685aa0dcda2eaf3eba24c4a29d5c3eb84e4 | [
"MIT"
] | null | null | null | src/restfw/config/external_links.py | Cykooz/restfw | d94db685aa0dcda2eaf3eba24c4a29d5c3eb84e4 | [
"MIT"
] | null | null | null | """
:Authors: cykooz
:Date: 12.01.2021
"""
from zope.interface.verify import verifyObject
from .common import derive_fabric
from .. import interfaces
def add_external_link_fabric(
config, fabric, name, resource_type=interfaces.IHalResource,
title='', description='', optional=False, templated=False,
... | 31.620968 | 85 | 0.680439 | from zope.interface.verify import verifyObject
from .common import derive_fabric
from .. import interfaces
def add_external_link_fabric(
config, fabric, name, resource_type=interfaces.IHalResource,
title='', description='', optional=False, templated=False,
**predicates
):
dotted = config... | true | true |
f76acc7a3a43a260400b2be7b374197e9a27f221 | 2,647 | py | Python | nn/train/log.py | mbed92/rl-physnet | 62b6e8a84a6704a50855434933a147f507f94263 | [
"MIT"
] | 1 | 2021-07-02T13:33:49.000Z | 2021-07-02T13:33:49.000Z | nn/train/log.py | mbed92/dao-perception | 62b6e8a84a6704a50855434933a147f507f94263 | [
"MIT"
] | 3 | 2021-09-01T16:16:42.000Z | 2021-09-10T11:18:59.000Z | nn/train/log.py | mbed92/dao-perception | 62b6e8a84a6704a50855434933a147f507f94263 | [
"MIT"
] | 1 | 2021-08-30T08:26:21.000Z | 2021-08-30T08:26:21.000Z | import os
import tensorflow as tf
from tqdm import tqdm
class ExperimentHandler:
def __init__(self, working_path, out_name, max_to_keep=3, **objects_to_save) -> None:
super().__init__()
# prepare log writers
train_log_path = _get_or_create_dir(working_path, out_name, 'logs', 'train')
... | 31.141176 | 118 | 0.701171 | import os
import tensorflow as tf
from tqdm import tqdm
class ExperimentHandler:
def __init__(self, working_path, out_name, max_to_keep=3, **objects_to_save) -> None:
super().__init__()
train_log_path = _get_or_create_dir(working_path, out_name, 'logs', 'train')
val_log_path = _... | true | true |
f76acc881f9a49f22f6eeaeba9e6b78a515b1b65 | 916 | py | Python | chris/tests/mocks/data/pagination.py | FNNDSC/caw | a41761c4502481f6ccb60ef6e9956464c9b30eb9 | [
"MIT"
] | null | null | null | chris/tests/mocks/data/pagination.py | FNNDSC/caw | a41761c4502481f6ccb60ef6e9956464c9b30eb9 | [
"MIT"
] | 11 | 2021-04-23T21:25:29.000Z | 2022-03-14T02:40:26.000Z | chris/tests/mocks/data/pagination.py | FNNDSC/caw | a41761c4502481f6ccb60ef6e9956464c9b30eb9 | [
"MIT"
] | 1 | 2021-10-17T16:18:30.000Z | 2021-10-17T16:18:30.000Z | responses = {
'https://example.com/api/v1/something/': {
'count': 5,
'next': 'https://example.com/api/v1/something/?limit=3&offset=3',
'previous': None,
'results': [
{'id': 1}, {'id': 2}, {'id': 3}
],
'collection_links': {}
},
'https://example.com/... | 30.533333 | 73 | 0.470524 | responses = {
'https://example.com/api/v1/something/': {
'count': 5,
'next': 'https://example.com/api/v1/something/?limit=3&offset=3',
'previous': None,
'results': [
{'id': 1}, {'id': 2}, {'id': 3}
],
'collection_links': {}
},
'https://example.com/... | true | true |
f76accbbabcb76f91b7e47e6952e4e2cdbeb75d3 | 46 | py | Python | venv/Lib/site-packages/hachoir/metadata/__main__.py | surendra841/my-sample-test | adafe6d8964d8edcabf9c5e18bde9bdac90904b6 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/hachoir/metadata/__main__.py | surendra841/my-sample-test | adafe6d8964d8edcabf9c5e18bde9bdac90904b6 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/hachoir/metadata/__main__.py | surendra841/my-sample-test | adafe6d8964d8edcabf9c5e18bde9bdac90904b6 | [
"MIT"
] | null | null | null | from hachoir.metadata.main import main
main()
| 15.333333 | 38 | 0.804348 | from hachoir.metadata.main import main
main()
| true | true |
f76accef346a521d5b51558cd65ca05b43773bff | 2,470 | py | Python | shapes/core/animation.py | josvromans/python_shapes | 2b5a77b63fa75802bfc511057c2e0f72512f118d | [
"MIT"
] | 7 | 2021-02-04T08:19:43.000Z | 2021-02-06T03:31:57.000Z | shapes/core/animation.py | josvromans/python_shapes | 2b5a77b63fa75802bfc511057c2e0f72512f118d | [
"MIT"
] | null | null | null | shapes/core/animation.py | josvromans/python_shapes | 2b5a77b63fa75802bfc511057c2e0f72512f118d | [
"MIT"
] | 1 | 2021-02-04T20:50:00.000Z | 2021-02-04T20:50:00.000Z | import glob
import os
import shutil
import subprocess
from settings import (
BITRATE, FRAMES_PER_SECOND, IMAGE_EXTENSION, IMAGE_DIRECTORY_NAME,
VIDEO_CODEC, VIDEO_EXTENSION, VIDEO_PIXEL_FORMAT,
)
from shapes.core.image import get_datetime_string
def make_movie(name=None):
"""
Take all files with exte... | 35.797101 | 119 | 0.702024 | import glob
import os
import shutil
import subprocess
from settings import (
BITRATE, FRAMES_PER_SECOND, IMAGE_EXTENSION, IMAGE_DIRECTORY_NAME,
VIDEO_CODEC, VIDEO_EXTENSION, VIDEO_PIXEL_FORMAT,
)
from shapes.core.image import get_datetime_string
def make_movie(name=None):
file_name = '{}_{}_m... | true | true |
f76accfaeccfd3e0638c6f6a67a8213afa5bc606 | 7,890 | py | Python | src/python/pants/pantsd/pants_daemon.py | adam-singer/pants | 0fc6fb71e983487b3795ce6f34292967841e994d | [
"Apache-2.0"
] | null | null | null | src/python/pants/pantsd/pants_daemon.py | adam-singer/pants | 0fc6fb71e983487b3795ce6f34292967841e994d | [
"Apache-2.0"
] | null | null | null | src/python/pants/pantsd/pants_daemon.py | adam-singer/pants | 0fc6fb71e983487b3795ce6f34292967841e994d | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import logging
import os
import sys
import time
import warnings
from typing import Any
from setproctitle import setproctitle as set_process_title
from... | 38.300971 | 99 | 0.7 |
from __future__ import annotations
import logging
import os
import sys
import time
import warnings
from typing import Any
from setproctitle import setproctitle as set_process_title
from pants.base.build_environment import get_buildroot
from pants.base.exception_sink import ExceptionSink
from pants.bin.daemon_pants_... | true | true |
f76acd7e80ac175a7a32f8921a16e858f369cf20 | 78,685 | py | Python | python/ccxt/async_support/deribit.py | mariuszskon/ccxt | 13253de7346e33cd384f79abf7dfb64dcbfdc35f | [
"MIT"
] | 4 | 2021-09-24T09:18:36.000Z | 2022-03-15T16:47:09.000Z | python/ccxt/async_support/deribit.py | mariuszskon/ccxt | 13253de7346e33cd384f79abf7dfb64dcbfdc35f | [
"MIT"
] | null | null | null | python/ccxt/async_support/deribit.py | mariuszskon/ccxt | 13253de7346e33cd384f79abf7dfb64dcbfdc35f | [
"MIT"
] | 2 | 2021-10-01T21:51:37.000Z | 2021-10-02T16:23:05.000Z | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... | 45.987726 | 284 | 0.494008 |
from ccxt.async_support.base.exchange import Exchange
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors im... | true | true |
f76acdcdba625ac5e3eafdb5c52e9cdcf33d6b0c | 5,360 | py | Python | data/p3BR/R1/benchmark/startQiskit_Class408.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_Class408.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_Class408.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=73
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 29.130435 | 140 | 0.629478 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.mock import FakeVigo, ... | true | true |
f76ace4c4fe13270586cd5381eea6551896491a2 | 1,233 | py | Python | scripts/ehomd_download.py | pirovc/grimer | 169f8d3009004d6d2f4ca4d3e7dfec819078cb34 | [
"MIT"
] | 5 | 2021-06-24T03:19:47.000Z | 2021-12-18T22:33:04.000Z | scripts/ehomd_download.py | pirovc/grimer | 169f8d3009004d6d2f4ca4d3e7dfec819078cb34 | [
"MIT"
] | 1 | 2022-02-04T14:52:40.000Z | 2022-03-07T10:04:54.000Z | scripts/ehomd_download.py | pirovc/grimer | 169f8d3009004d6d2f4ca4d3e7dfec819078cb34 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import pandas as pd
import sys
import urllib.request
import re
def get_taxid(url):
try:
sys.stderr.write(url+"\n")
assembly_stats = url + "/" + url.split("/")[-1] + "_assembly_stats.txt"
filedata = urllib.request.urlopen(assembly_stats).read().decode()
x = re... | 33.324324 | 119 | 0.607461 | import pandas as pd
import sys
import urllib.request
import re
def get_taxid(url):
try:
sys.stderr.write(url+"\n")
assembly_stats = url + "/" + url.split("/")[-1] + "_assembly_stats.txt"
filedata = urllib.request.urlopen(assembly_stats).read().decode()
x = re.search("# Taxid:[\s0-9... | true | true |
f76ad2014ad5da83e23423c6e719ce748c37bfb6 | 1,727 | py | Python | pytorch/run.py | markpp/object_detectors | 8a6cac32ec2d8b578c0d301feceef19390343e85 | [
"MIT"
] | 2 | 2021-03-10T13:13:46.000Z | 2021-03-11T09:03:33.000Z | pytorch/run.py | markpp/object_detectors | 8a6cac32ec2d8b578c0d301feceef19390343e85 | [
"MIT"
] | null | null | null | pytorch/run.py | markpp/object_detectors | 8a6cac32ec2d8b578c0d301feceef19390343e85 | [
"MIT"
] | null | null | null | import argparse
import os
import random
import torch
import pytorch_lightning as pl
if __name__ == '__main__':
"""
Trains
Command:
python train.py
"""
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-f", "--fine", type=str,
... | 23.986111 | 278 | 0.613781 | import argparse
import os
import random
import torch
import pytorch_lightning as pl
if __name__ == '__main__':
"""
Trains
Command:
python train.py
"""
ap = argparse.ArgumentParser()
ap.add_argument("-f", "--fine", type=str,
default='fine', help="Flag")
ap.... | false | true |
f76ad236bf298fdd6911bfdedf90a76d406aa4a1 | 13,367 | py | Python | wikidata/wd2cg.py | causegraph/cg-data-scripts | 98cd7e281324daf38bfa905feb62a5f579f3aacc | [
"MIT"
] | null | null | null | wikidata/wd2cg.py | causegraph/cg-data-scripts | 98cd7e281324daf38bfa905feb62a5f579f3aacc | [
"MIT"
] | 7 | 2017-05-28T20:07:53.000Z | 2018-01-27T15:49:03.000Z | wikidata/wd2cg.py | causegraph/cg-data-scripts | 98cd7e281324daf38bfa905feb62a5f579f3aacc | [
"MIT"
] | 1 | 2018-12-11T11:31:59.000Z | 2018-12-11T11:31:59.000Z | #!/usr/bin/env python3
"""make causegraph based on wikidata JSON dump"""
import json
import pprint
import sys
from collections import Counter
import networkx as nx
from wd_constants import (all_times, cg_rels, times_plus_nested,
combined_inverses, lang_order, likely_nonspecific,
... | 37.337989 | 80 | 0.585921 |
import json
import pprint
import sys
from collections import Counter
import networkx as nx
from wd_constants import (all_times, cg_rels, times_plus_nested,
combined_inverses, lang_order, likely_nonspecific,
instance_of)
def get_label(obj):
has_sitelinks = 'si... | true | true |
f76ad325f030046970c3561051a93ad5f04e27ab | 24,881 | py | Python | src/intel/genxml/gen_pack_header.py | thermasol/mesa3d | 6f1bc4e7edfface197ef281cffdf399b5389e24a | [
"MIT"
] | null | null | null | src/intel/genxml/gen_pack_header.py | thermasol/mesa3d | 6f1bc4e7edfface197ef281cffdf399b5389e24a | [
"MIT"
] | null | null | null | src/intel/genxml/gen_pack_header.py | thermasol/mesa3d | 6f1bc4e7edfface197ef281cffdf399b5389e24a | [
"MIT"
] | null | null | null | #encoding=utf-8
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import argparse
import ast
import xml.parsers.expat
import re
import sys
import copy
import textwrap
license = """/*
* Copyright (C) 2016 Intel Corporation
*
* Permission is hereby granted, free of charge, t... | 33.851701 | 143 | 0.538885 |
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import argparse
import ast
import xml.parsers.expat
import re
import sys
import copy
import textwrap
license = """/*
* Copyright (C) 2016 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obt... | true | true |
f76ad391a14d2e2fe4e3204c76adb2fa9ba138ea | 6,561 | py | Python | hifi_gan/meldataset.py | Hiroshiba/hifi-gan | 17601a07573309ee305c58bf87a041f267b1c0c8 | [
"MIT"
] | null | null | null | hifi_gan/meldataset.py | Hiroshiba/hifi-gan | 17601a07573309ee305c58bf87a041f267b1c0c8 | [
"MIT"
] | null | null | null | hifi_gan/meldataset.py | Hiroshiba/hifi-gan | 17601a07573309ee305c58bf87a041f267b1c0c8 | [
"MIT"
] | null | null | null | import math
import os
import random
import torch
import torch.utils.data
import numpy as np
from librosa.core import load
from librosa.util import normalize
from librosa.filters import mel as librosa_mel_fn
MAX_WAV_VALUE = 32768.0
def load_wav(full_path, sampling_rate=None):
if os.path.splitext(full_path)[1] != ... | 37.706897 | 115 | 0.617132 | import math
import os
import random
import torch
import torch.utils.data
import numpy as np
from librosa.core import load
from librosa.util import normalize
from librosa.filters import mel as librosa_mel_fn
MAX_WAV_VALUE = 32768.0
def load_wav(full_path, sampling_rate=None):
if os.path.splitext(full_path)[1] != ... | true | true |
f76ad4a0c7f1f7e8edb0022ebebcf14e5f8a2da2 | 27 | py | Python | gsflow/modsim/__init__.py | pygsflow/pygsflow | 83860cd58078017a65e1633b1192469777f1ce15 | [
"CC0-1.0",
"BSD-3-Clause"
] | 17 | 2019-11-11T02:49:29.000Z | 2022-02-17T03:45:19.000Z | gsflow/modsim/__init__.py | jonathanqv/pygsflow | d671fdd84245ecb421a0fcab17a578425b514e93 | [
"Unlicense"
] | 21 | 2019-07-10T21:45:11.000Z | 2022-02-22T17:57:20.000Z | gsflow/modsim/__init__.py | jonathanqv/pygsflow | d671fdd84245ecb421a0fcab17a578425b514e93 | [
"Unlicense"
] | 8 | 2019-11-11T02:49:36.000Z | 2021-09-30T18:43:45.000Z | from .modsim import Modsim
| 13.5 | 26 | 0.814815 | from .modsim import Modsim
| true | true |
f76ad5097513eca07b585c5b6fa5594ce999f6d7 | 8,800 | py | Python | translate/translate.py | Jonhory/flutter_tool_py | 91b68783e17d2bb962ee11697a45f84915568eba | [
"MIT"
] | 1 | 2021-11-08T01:45:13.000Z | 2021-11-08T01:45:13.000Z | translate/translate.py | Jonhory/flutter_tool_py | 91b68783e17d2bb962ee11697a45f84915568eba | [
"MIT"
] | null | null | null | translate/translate.py | Jonhory/flutter_tool_py | 91b68783e17d2bb962ee11697a45f84915568eba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# /usr/bin/env python
# coding=utf8
import hashlib
import random
import os
import requests
import sys
from urllib import parse
import json
from string import punctuation
# 翻译能力来自百度翻译
# https://api.fanyi.baidu.com/
# appid 和 secretKey 获取自[百度翻译开放平台管理控制器]
# https://api.fanyi.baidu.com/api/trans/... | 31.205674 | 120 | 0.513295 |
import hashlib
import random
import os
import requests
import sys
from urllib import parse
import json
from string import punctuation
appid = ''
secretKey = ''
baseUrl = '/api/trans/vip/translate'
add_punc = ':,。、【】“”;()《》‘’{}?!⑦()、%^>℃.”“^-——=&#@¥'
all_punc = punctuation + add_punc
def save_file(content, save_pa... | true | true |
f76ad543d4282809c9295c12571da22ec85cd8f6 | 7,759 | py | Python | scripts/dv_bulk_releaser.py | ubc-library-rc/dryad2dataverse | bf23363e44ac15ad51776c3ceda9416f13dfb4ce | [
"MIT"
] | 3 | 2021-03-16T21:21:15.000Z | 2021-06-23T06:47:16.000Z | scripts/dv_bulk_releaser.py | ubc-library-rc/dryad2dataverse | bf23363e44ac15ad51776c3ceda9416f13dfb4ce | [
"MIT"
] | 3 | 2021-09-22T16:26:09.000Z | 2022-02-04T19:59:06.000Z | scripts/dv_bulk_releaser.py | ubc-library-rc/dryad2dataverse | bf23363e44ac15ad51776c3ceda9416f13dfb4ce | [
"MIT"
] | null | null | null | '''
Bulk release script for Dataverse.
Very useful if you've just imported a bunch of Dryad studies.
'''
import argparse
import time
import requests
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
RETRY_STRATEGY = Retry(total=10,
status_forcelist=[429, 500, 502, 503, ... | 38.60199 | 100 | 0.566568 |
import argparse
import time
import requests
from requests.adapters import HTTPAdapter
from urllib3.util import Retry
RETRY_STRATEGY = Retry(total=10,
status_forcelist=[429, 500, 502, 503, 504],
method_whitelist=['HEAD', 'GET', 'OPTIONS',
... | true | true |
f76ad65524125249b874b1dc79def5b00db7b649 | 722 | py | Python | stravapy/stravapy.py | JoshGuarino/stravapy | b7cb404137535f2ccda2fa03b9ba65fc6d4e289d | [
"MIT"
] | null | null | null | stravapy/stravapy.py | JoshGuarino/stravapy | b7cb404137535f2ccda2fa03b9ba65fc6d4e289d | [
"MIT"
] | null | null | null | stravapy/stravapy.py | JoshGuarino/stravapy | b7cb404137535f2ccda2fa03b9ba65fc6d4e289d | [
"MIT"
] | null | null | null | from resources import *
from request import Request
from oauth import Oauth
class Stravapy:
def __init__(self, access_token):
self.access_token = access_token
self.base_url = 'https://www.strava.com/api/v3'
self.headers = { 'Authorization' : f'Bearer: {access_token}' }
self.activiti... | 38 | 70 | 0.68144 | from resources import *
from request import Request
from oauth import Oauth
class Stravapy:
def __init__(self, access_token):
self.access_token = access_token
self.base_url = 'https://www.strava.com/api/v3'
self.headers = { 'Authorization' : f'Bearer: {access_token}' }
self.activiti... | true | true |
f76ad716a887e4fab2e74045fdd5d017d5bf8e74 | 15,321 | py | Python | DeNN/dataset_loader/data_loader.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | DeNN/dataset_loader/data_loader.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | DeNN/dataset_loader/data_loader.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | from torch.utils.data import DataLoader, Dataset
from torchvision import datasets
from .util import download_and_extract_archive
import os, glob
from PIL import Image
class DatasetMnist:
"""
This class loads MNIST dataset with applied transformations
# Functions:
__repr__:
... | 51.07 | 269 | 0.626134 | from torch.utils.data import DataLoader, Dataset
from torchvision import datasets
from .util import download_and_extract_archive
import os, glob
from PIL import Image
class DatasetMnist:
def __repr__(self):
return "Loading MNIST Dataset"
def __str__(self):
return "Loading MNIST Dataset"
de... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.