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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74dec2d0603c04defa85cb69d500b43e8b1a270 | 2,903 | py | Python | nb_prep/cli.py | allianz-direct/-precommit_nbconvert_rename | d9d50c97d56e61939bfef08d4158c1efe60b63ab | [
"MIT"
] | 4 | 2022-01-14T12:19:16.000Z | 2022-01-18T22:55:29.000Z | nb_prep/cli.py | allianz-direct/-precommit_nbconvert_rename | d9d50c97d56e61939bfef08d4158c1efe60b63ab | [
"MIT"
] | 4 | 2022-01-20T15:20:12.000Z | 2022-02-17T12:24:31.000Z | nb_prep/cli.py | allianz-direct/-precommit_nbconvert_rename | d9d50c97d56e61939bfef08d4158c1efe60b63ab | [
"MIT"
] | null | null | null | import typer
import os
from pathlib import Path
from typing import List, Optional
from nb_prep.files import (
find_files_in_paths,
insert_commithash_filename_placeholder,
)
from nb_prep._utils import git_version
from nb_prep.nb_convert_strip import convert_notebook
app = typer.Typer()
@app.command()
def re... | 32.617978 | 116 | 0.687565 | import typer
import os
from pathlib import Path
from typing import List, Optional
from nb_prep.files import (
find_files_in_paths,
insert_commithash_filename_placeholder,
)
from nb_prep._utils import git_version
from nb_prep.nb_convert_strip import convert_notebook
app = typer.Typer()
@app.command()
def re... | true | true |
f74ded39b00992159712b6c031cac44c3546c0e9 | 111 | py | Python | Python/kornislav.py | mimseyedi/Kattis | a99ea2112544e89cc466feb7d81ffe6eb017f7e2 | [
"MIT"
] | null | null | null | Python/kornislav.py | mimseyedi/Kattis | a99ea2112544e89cc466feb7d81ffe6eb017f7e2 | [
"MIT"
] | null | null | null | Python/kornislav.py | mimseyedi/Kattis | a99ea2112544e89cc466feb7d81ffe6eb017f7e2 | [
"MIT"
] | null | null | null | numbers = sorted((map(int, input().split())))
print(min(numbers[0], numbers[1]) * min(numbers[2], numbers[3]))
| 37 | 64 | 0.648649 | numbers = sorted((map(int, input().split())))
print(min(numbers[0], numbers[1]) * min(numbers[2], numbers[3]))
| true | true |
f74dee86b33c93aedd3ad25293312e1bc12dc1fa | 1,233 | py | Python | nipype/interfaces/camino/tests/test_auto_Shredder.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2019-01-25T18:20:51.000Z | 2019-07-30T20:51:51.000Z | nipype/interfaces/camino/tests/test_auto_Shredder.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/camino/tests/test_auto_Shredder.py | sebastientourbier/nipype | 99c5904176481520c5bf42a501aae1a12184e672 | [
"Apache-2.0"
] | 2 | 2018-01-25T19:48:17.000Z | 2019-01-25T18:20:52.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..convert import Shredder
def test_Shredder_inputs():
input_map = dict(args=dict(argstr='%s',
),
chunksize=dict(argstr='%d',
position=2,
units='NA',
),
environ=dict(nohash=True,
usedefaul... | 23.264151 | 67 | 0.615572 | from __future__ import unicode_literals
from ..convert import Shredder
def test_Shredder_inputs():
input_map = dict(args=dict(argstr='%s',
),
chunksize=dict(argstr='%d',
position=2,
units='NA',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
... | true | true |
f74deeab104a47c6cc8f0129533011f60546cc91 | 12,055 | py | Python | triviaUtils.py | charlesmadere/cynanbot | 67c5f09eb553ddd5121594abe3974e9100728bda | [
"Unlicense"
] | 2 | 2020-07-09T06:11:49.000Z | 2020-11-09T21:56:09.000Z | triviaUtils.py | charlesmadere/cynanbot | 67c5f09eb553ddd5121594abe3974e9100728bda | [
"Unlicense"
] | null | null | null | triviaUtils.py | charlesmadere/cynanbot | 67c5f09eb553ddd5121594abe3974e9100728bda | [
"Unlicense"
] | 1 | 2020-12-04T06:19:24.000Z | 2020-12-04T06:19:24.000Z | import locale
import random
from typing import List
import CynanBotCommon.utils as utils
from CynanBotCommon.cuteness.cutenessResult import CutenessResult
from CynanBotCommon.trivia.absTriviaQuestion import AbsTriviaQuestion
from CynanBotCommon.trivia.triviaScoreResult import TriviaScoreResult
from CynanBotCommon.triv... | 45.836502 | 228 | 0.647117 | import locale
import random
from typing import List
import CynanBotCommon.utils as utils
from CynanBotCommon.cuteness.cutenessResult import CutenessResult
from CynanBotCommon.trivia.absTriviaQuestion import AbsTriviaQuestion
from CynanBotCommon.trivia.triviaScoreResult import TriviaScoreResult
from CynanBotCommon.triv... | true | true |
f74df111202ae436df1b2d100a6ae08656ee96d0 | 9,674 | py | Python | plotly/graph_objs/histogram/_xbins.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/graph_objs/histogram/_xbins.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/graph_objs/histogram/_xbins.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class XBins(BaseTraceHierarchyType):
# end
# ---
@property
def end(self):
"""
Sets the end value for the x axis bins. The last bin may not
end exactly at this value, we increment the bin edge by `size`
... | 40.141079 | 76 | 0.586727 | from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class XBins(BaseTraceHierarchyType):
@property
def end(self):
return self['end']
@end.setter
def end(self, val):
self['end'] = val
@property
def size(self):
return self['size']
@... | true | true |
f74df134c53a3376ff9d37c8ba93b9d39cadeb02 | 11,256 | py | Python | src/sagemaker_training/smdataparallel.py | spidyDev/sagemaker-training-toolkit | 1f4691ab98967bd32e2860a6afc42001d0945ec9 | [
"Apache-2.0"
] | null | null | null | src/sagemaker_training/smdataparallel.py | spidyDev/sagemaker-training-toolkit | 1f4691ab98967bd32e2860a6afc42001d0945ec9 | [
"Apache-2.0"
] | null | null | null | src/sagemaker_training/smdataparallel.py | spidyDev/sagemaker-training-toolkit | 1f4691ab98967bd32e2860a6afc42001d0945ec9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the 'license' file acc... | 35.620253 | 130 | 0.612296 | import inspect
import json
import logging
import os
import subprocess
import time
import paramiko
import gethostname
from sagemaker_training import environment, errors, logging_config, process, timeout
logger = logging_config.get_logger()
logging.getLogger("paramiko").setLevel(logging.INFO)
class SMDataParallelRun... | true | true |
f74df15dcdcc9d3512c4a52b5129223a91fcc400 | 3,599 | py | Python | env/lib/python3.4/site-packages/pymongo/ssl_match_hostname.py | musicrighter/P2-Iteration-0 | dcf2f2f2a5a8849e57ff3c2e9f2ab4cdfca9b86d | [
"Artistic-2.0"
] | 249 | 2016-09-03T11:50:53.000Z | 2022-01-06T07:12:28.000Z | env/lib/python3.4/site-packages/pymongo/ssl_match_hostname.py | musicrighter/P2-Iteration-0 | dcf2f2f2a5a8849e57ff3c2e9f2ab4cdfca9b86d | [
"Artistic-2.0"
] | 69 | 2016-12-06T02:29:49.000Z | 2021-04-08T08:20:42.000Z | env/lib/python3.4/site-packages/pymongo/ssl_match_hostname.py | musicrighter/P2-Iteration-0 | dcf2f2f2a5a8849e57ff3c2e9f2ab4cdfca9b86d | [
"Artistic-2.0"
] | 85 | 2016-11-28T10:46:21.000Z | 2021-06-08T01:12:18.000Z | # Backport of the match_hostname logic introduced in python 3.2
# http://hg.python.org/releasing/3.3.5/file/993955b807b3/Lib/ssl.py
import re
class CertificateError(ValueError):
pass
def _dnsname_match(dn, hostname, max_wildcards=1):
"""Matching according to RFC 6125, section 6.4.3
http://tools.ietf.o... | 35.633663 | 78 | 0.613782 |
import re
class CertificateError(ValueError):
pass
def _dnsname_match(dn, hostname, max_wildcards=1):
pats = []
if not dn:
return False
parts = dn.split(r'.')
leftmost = parts[0]
remainder = parts[1:]
wildcards = leftmost.count('*')
if wildcards > max_wildcards:
... | true | true |
f74df1941291269b24778bc2489d638ff7321faa | 3,465 | py | Python | scripts/black_and_white.py | cyberj0g/verification-classifier | efb19a3864e27a7f149a1c27ee8e13eaa19f96eb | [
"MIT"
] | 8 | 2019-06-06T08:16:45.000Z | 2021-06-26T11:53:48.000Z | scripts/black_and_white.py | cyberj0g/verification-classifier | efb19a3864e27a7f149a1c27ee8e13eaa19f96eb | [
"MIT"
] | 95 | 2019-03-27T08:36:01.000Z | 2022-02-10T00:15:20.000Z | scripts/black_and_white.py | cyberj0g/verification-classifier | efb19a3864e27a7f149a1c27ee8e13eaa19f96eb | [
"MIT"
] | 8 | 2019-02-28T11:21:46.000Z | 2022-03-21T07:34:20.000Z | import argparse
import subprocess
from os import listdir, makedirs
from os.path import isfile, join, exists
import multiprocessing
parser = argparse.ArgumentParser(description='Generate renditions ')
parser.add_argument('-i', "--input", action='store', help='Folder where the renditions are', type=str,
... | 31.5 | 119 | 0.657143 | import argparse
import subprocess
from os import listdir, makedirs
from os.path import isfile, join, exists
import multiprocessing
parser = argparse.ArgumentParser(description='Generate renditions ')
parser.add_argument('-i', "--input", action='store', help='Folder where the renditions are', type=str,
... | true | true |
f74df40871a6c8de21986b4bd2bb941d2286f172 | 316 | py | Python | tests/test_exercises.py | fredrikj31/Python-LectioScraper | 12275fdedffacf0c387addacc57b0565093823f7 | [
"MIT"
] | 3 | 2020-04-19T19:53:15.000Z | 2021-12-11T21:19:50.000Z | tests/test_electives.py | fredrikj31/LectioScraper | 12275fdedffacf0c387addacc57b0565093823f7 | [
"MIT"
] | 6 | 2020-05-28T11:17:22.000Z | 2022-02-06T20:01:22.000Z | tests/test_exercises.py | fredrikj31/LectioScraper | 12275fdedffacf0c387addacc57b0565093823f7 | [
"MIT"
] | null | null | null | # Getting into the main folder.
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from tests.details import lectioUsername, lectioPassword, schoolId
from src.lectio import Lectio
lec = Lectio(lectioUsername, lectioPassword, schoolId)
print(lec.getExercises()) | 28.727273 | 82 | 0.781646 | import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from tests.details import lectioUsername, lectioPassword, schoolId
from src.lectio import Lectio
lec = Lectio(lectioUsername, lectioPassword, schoolId)
print(lec.getExercises()) | true | true |
f74df4ac592a375e715e992b4854e0bf766ac654 | 865 | py | Python | lab1_rest/project/apps/core/views.py | mratkovic/RZNU-Lab | 2930b249994619c2f17493544db2c0d471ca6cbc | [
"MIT"
] | null | null | null | lab1_rest/project/apps/core/views.py | mratkovic/RZNU-Lab | 2930b249994619c2f17493544db2c0d471ca6cbc | [
"MIT"
] | null | null | null | lab1_rest/project/apps/core/views.py | mratkovic/RZNU-Lab | 2930b249994619c2f17493544db2c0d471ca6cbc | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from .models import User, Photo
from .serializers import UserSerializer, PhotoSerializer
from .mixins import RequestLogViewMixin
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.permissions import IsAuthenticated, IsAuthenticate... | 41.190476 | 84 | 0.834682 | from rest_framework import viewsets
from .models import User, Photo
from .serializers import UserSerializer, PhotoSerializer
from .mixins import RequestLogViewMixin
from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.permissions import IsAuthenticated, IsAuthenticate... | true | true |
f74df55e80cf00c76d1fc1af42eb0cab4910aa43 | 4,625 | py | Python | python/schedules.py | dmayrand/DivAE-client-beta | f97b2655ec3ee2de7b8afe92324eb965c13d06f2 | [
"MIT"
] | null | null | null | python/schedules.py | dmayrand/DivAE-client-beta | f97b2655ec3ee2de7b8afe92324eb965c13d06f2 | [
"MIT"
] | null | null | null | python/schedules.py | dmayrand/DivAE-client-beta | f97b2655ec3ee2de7b8afe92324eb965c13d06f2 | [
"MIT"
] | null | null | null | import json
import pdb
import os.path
import sys
sys.path.append( "../lib" )
from iseclogger import Logger
from datetime import datetime, timedelta
import pdb
class ScheduleObject:
_sid= ""
_hour = ""
_duration = ""
_minute = ""
_everyXDay = ""
class PeripheralSchedulesObject:
_peripher... | 29.83871 | 89 | 0.58573 | import json
import pdb
import os.path
import sys
sys.path.append( "../lib" )
from iseclogger import Logger
from datetime import datetime, timedelta
import pdb
class ScheduleObject:
_sid= ""
_hour = ""
_duration = ""
_minute = ""
_everyXDay = ""
class PeripheralSchedulesObject:
_peripher... | true | true |
f74df56cf4508a6c39029c2e251d6ece919fb11e | 418 | py | Python | venv/Scripts/pip3-script.py | IseMike/TicketSystem | 9619897c2c80ecc6ce082226170a9605c1c7015b | [
"MIT"
] | null | null | null | venv/Scripts/pip3-script.py | IseMike/TicketSystem | 9619897c2c80ecc6ce082226170a9605c1c7015b | [
"MIT"
] | null | null | null | venv/Scripts/pip3-script.py | IseMike/TicketSystem | 9619897c2c80ecc6ce082226170a9605c1c7015b | [
"MIT"
] | null | null | null | #!C:\Users\Isaac\PycharmProjects\TicketSystem\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==19.0.3','console_scripts','pip3'
__requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.... | 32.153846 | 69 | 0.674641 | __requires__ = 'pip==19.0.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==19.0.3', 'console_scripts', 'pip3')()
)
| true | true |
f74df616f951ce56247c204f64b89e5bda2a0825 | 8,265 | py | Python | queue_services/payment-reconciliations/tests/integration/factory.py | bcgov/sbc-pay | 142872e61109f097ee7f926375c3139421f38849 | [
"Apache-2.0"
] | 4 | 2020-03-23T21:37:02.000Z | 2021-06-15T11:25:22.000Z | queue_services/payment-reconciliations/tests/integration/factory.py | bcgov/sbc-pay | 142872e61109f097ee7f926375c3139421f38849 | [
"Apache-2.0"
] | 757 | 2019-05-02T17:53:52.000Z | 2022-03-31T22:42:01.000Z | queue_services/payment-reconciliations/tests/integration/factory.py | bcgov/sbc-pay | 142872e61109f097ee7f926375c3139421f38849 | [
"Apache-2.0"
] | 39 | 2019-01-30T20:05:36.000Z | 2022-03-24T15:07:54.000Z | # Copyright © 2019 Province of British Columbia
#
# 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... | 44.197861 | 119 | 0.628917 |
from datetime import datetime
from pay_api.models import (
CfsAccount, DistributionCode, Invoice, InvoiceReference, Payment, PaymentAccount, PaymentLineItem,
PaymentTransaction, Receipt, StatementSettings)
from pay_api.utils.enums import (
CfsAccountStatus, InvoiceReferenceStatus, InvoiceStatus, LineItem... | true | true |
f74df6d3075b15ab52afeaa0881e201b797b5baf | 362 | py | Python | test/test_cython_1.py | flauted/protovoc | e46b33faf7a8c9eb988c330d0c501f523bd342f3 | [
"BSD-3-Clause"
] | null | null | null | test/test_cython_1.py | flauted/protovoc | e46b33faf7a8c9eb988c330d0c501f523bd342f3 | [
"BSD-3-Clause"
] | null | null | null | test/test_cython_1.py | flauted/protovoc | e46b33faf7a8c9eb988c330d0c501f523bd342f3 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from test.general_tests import NumericalizationTestSuite
from protovoc.numericalization.cython.cython_1 import Numericalization
from protovoc.vocab.cython import Vocab
class TestCython1Numericalization(unittest.TestCase, NumericalizationTestSuite):
_voc = Vocab
_num = Numericalization
if __... | 24.133333 | 80 | 0.81768 | import unittest
from test.general_tests import NumericalizationTestSuite
from protovoc.numericalization.cython.cython_1 import Numericalization
from protovoc.vocab.cython import Vocab
class TestCython1Numericalization(unittest.TestCase, NumericalizationTestSuite):
_voc = Vocab
_num = Numericalization
if __... | true | true |
f74df7ee4e0d416a4a074f4dfd70150dae40b8bc | 4,411 | py | Python | rest_framework/mixins.py | blackjackgg/drf-with-history-track | dfc107c223a7338fa56164d41a32f6b94b6d9025 | [
"BSD-3-Clause"
] | 1 | 2021-06-27T07:21:13.000Z | 2021-06-27T07:21:13.000Z | rest_framework/mixins.py | blackjackgg/drf-with-history-track | dfc107c223a7338fa56164d41a32f6b94b6d9025 | [
"BSD-3-Clause"
] | null | null | null | rest_framework/mixins.py | blackjackgg/drf-with-history-track | dfc107c223a7338fa56164d41a32f6b94b6d9025 | [
"BSD-3-Clause"
] | 1 | 2021-07-19T07:15:59.000Z | 2021-07-19T07:15:59.000Z | """
Basic building blocks for generic class based views.
We don't bind behaviour to http method handlers yet,
which allows mixin classes to be composed in interesting ways.
"""
from __future__ import unicode_literals
import json
from rest_framework import status
from rest_framework.response import Response
from rest... | 30.631944 | 107 | 0.643618 | """
Basic building blocks for generic class based views.
We don't bind behaviour to http method handlers yet,
which allows mixin classes to be composed in interesting ways.
"""
from __future__ import unicode_literals
import json
from rest_framework import status
from rest_framework.response import Response
from rest... | false | true |
f74df928a7ba09d4c4a35c54fcfc0b6f3c6c38fb | 298 | py | Python | doubly_linked_list.py | Nikhilxavier/Linked-List | b934985d937edd2cd4a683d751a930aacd7f96bf | [
"BSD-3-Clause"
] | null | null | null | doubly_linked_list.py | Nikhilxavier/Linked-List | b934985d937edd2cd4a683d751a930aacd7f96bf | [
"BSD-3-Clause"
] | null | null | null | doubly_linked_list.py | Nikhilxavier/Linked-List | b934985d937edd2cd4a683d751a930aacd7f96bf | [
"BSD-3-Clause"
] | null | null | null | """
Implementation of Doubly Linked List.
"""
# Author: Nikhil Xavier <nikhilxavier@yahoo.com>
# License: BSD 3 clause
class Node:
"""Node class for Doubly Linked List."""
def __init__(self, value):
self.value = value
self.next_node = None
self.prev_node = None
| 18.625 | 48 | 0.644295 |
class Node:
def __init__(self, value):
self.value = value
self.next_node = None
self.prev_node = None
| true | true |
f74dfa155a785c76912476cdc773d9cd7c5bd8da | 381 | py | Python | lib/twobit/setup_twobit.py | ifiddes/mus_strain_cactus | b56863f835892616d645f44476f5d7503acc9d7d | [
"MIT"
] | null | null | null | lib/twobit/setup_twobit.py | ifiddes/mus_strain_cactus | b56863f835892616d645f44476f5d7503acc9d7d | [
"MIT"
] | null | null | null | lib/twobit/setup_twobit.py | ifiddes/mus_strain_cactus | b56863f835892616d645f44476f5d7503acc9d7d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# A setup script to install the _twobit module
# ---
#
from distutils.core import setup
from distutils.extension import Extension
extensions = []
extensions.append(Extension("_twobit", ["_twobit.pyx"]))
def main():
setup(name="twobit",
ext_modules=extensions,
cmdclass={'build_ex... | 20.052632 | 56 | 0.674541 |
from distutils.core import setup
from distutils.extension import Extension
extensions = []
extensions.append(Extension("_twobit", ["_twobit.pyx"]))
def main():
setup(name="twobit",
ext_modules=extensions,
cmdclass={'build_ext': build_ext})
if __name__ == "__main__":
main()
| true | true |
f74dfb486ec09ed7ef22960d2d42189dcff3dc53 | 1,537 | py | Python | setup.py | wecreatepixels/django-oscar-wagtail | d67286f852fb5aebca16f9007f8ee687a0bcb93a | [
"MIT"
] | 48 | 2018-07-12T21:55:33.000Z | 2022-03-23T08:09:01.000Z | setup.py | wecreatepixels/django-oscar-wagtail | d67286f852fb5aebca16f9007f8ee687a0bcb93a | [
"MIT"
] | 7 | 2018-12-05T07:33:58.000Z | 2021-12-20T08:32:02.000Z | setup.py | wecreatepixels/django-oscar-wagtail | d67286f852fb5aebca16f9007f8ee687a0bcb93a | [
"MIT"
] | 32 | 2018-09-09T09:38:51.000Z | 2022-02-14T22:49:56.000Z | from setuptools import find_packages, setup
install_requires = [
'django-oscar>=1.6',
'wagtail>=2.0,<2.4',
]
docs_require = [
'sphinx>=1.4.0',
]
tests_require = [
'pytest-cov>=2.3.1',
'pytest-django>=3.0.0',
'pytest-pythonpath>=0.7',
'pytest>=3.0.3',
# Linting
'isort>=4.2.5',
... | 26.050847 | 70 | 0.603774 | from setuptools import find_packages, setup
install_requires = [
'django-oscar>=1.6',
'wagtail>=2.0,<2.4',
]
docs_require = [
'sphinx>=1.4.0',
]
tests_require = [
'pytest-cov>=2.3.1',
'pytest-django>=3.0.0',
'pytest-pythonpath>=0.7',
'pytest>=3.0.3',
'isort>=4.2.5',
'flake8>=... | true | true |
f74dfc0050e6f27b50f1571de91e23cd3b792a54 | 672 | py | Python | flash_multiple/hello.py | mikalegall/flask | 743faaf5ef6ef165612bbbc1b451613e522a5326 | [
"MIT"
] | null | null | null | flash_multiple/hello.py | mikalegall/flask | 743faaf5ef6ef165612bbbc1b451613e522a5326 | [
"MIT"
] | null | null | null | flash_multiple/hello.py | mikalegall/flask | 743faaf5ef6ef165612bbbc1b451613e522a5326 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, redirect, flash
app = Flask(__name__)
#Cross Site Request Forgery estämiseen
app.secret_key = "mikalegall"
@app.route('/')
def index():
message = "Tämä viesti on etusivun Flashin jonopuskurista"
flash(message)
return render_template('index.html')
@app.route("/uudelleenoh... | 25.846154 | 130 | 0.755952 | from flask import Flask, render_template, redirect, flash
app = Flask(__name__)
app.secret_key = "mikalegall"
@app.route('/')
def index():
message = "Tämä viesti on etusivun Flashin jonopuskurista"
flash(message)
return render_template('index.html')
@app.route("/uudelleenohjaus")
def viestiKayttajalle():
fla... | true | true |
f74dfcbd2fec5d702971ce63e6cbbd83a27d1770 | 5,043 | py | Python | typedstream/__main__.py | dgelessus/python-typedstream | aa485e4325be478d14bd1cad1d3609c8752ffebd | [
"MIT"
] | 3 | 2020-11-18T20:08:14.000Z | 2021-11-11T22:29:58.000Z | typedstream/__main__.py | dgelessus/python-typedstream | aa485e4325be478d14bd1cad1d3609c8752ffebd | [
"MIT"
] | null | null | null | typedstream/__main__.py | dgelessus/python-typedstream | aa485e4325be478d14bd1cad1d3609c8752ffebd | [
"MIT"
] | null | null | null | import argparse
import sys
import typing
from . import __version__
from . import advanced_repr
from . import archiver
from . import stream
def make_subcommand_parser(subs: typing.Any, name: str, *, help: str, description: str, **kwargs: typing.Any) -> argparse.ArgumentParser:
"""Add a subcommand parser with some s... | 30.75 | 137 | 0.750347 | import argparse
import sys
import typing
from . import __version__
from . import advanced_repr
from . import archiver
from . import stream
def make_subcommand_parser(subs: typing.Any, name: str, *, help: str, description: str, **kwargs: typing.Any) -> argparse.ArgumentParser:
ap = subs.add_parser(
name,
form... | true | true |
f74dfcc420014501b9c57615a459dbb8edcb1347 | 1,596 | py | Python | src/gamesbyexample/rainbow1.py | asweigart/gamesbyexample | 222bfc3b15ade1cf3bde158ba72a8b7a969ccc5a | [
"Python-2.0"
] | 83 | 2021-03-01T09:16:07.000Z | 2022-01-04T20:52:42.000Z | src/gamesbyexample/rainbow1.py | asweigart/gamesbyexample | 222bfc3b15ade1cf3bde158ba72a8b7a969ccc5a | [
"Python-2.0"
] | null | null | null | src/gamesbyexample/rainbow1.py | asweigart/gamesbyexample | 222bfc3b15ade1cf3bde158ba72a8b7a969ccc5a | [
"Python-2.0"
] | 9 | 2021-03-01T09:16:18.000Z | 2021-11-21T12:22:03.000Z | """Rainbow 1, by Al Sweigart al@inventwithpython.com
Shows a simple rainbow animation. Press Ctrl-C to stop.
Tags: tiny, artistic, bext, beginner, scrolling"""
__version__ = 0
import time, sys
try:
import bext
except ImportError:
print('This program requires the bext module, which you')
print('can install ... | 29.555556 | 72 | 0.568296 | __version__ = 0
import time, sys
try:
import bext
except ImportError:
print('This program requires the bext module, which you')
print('can install by following the instructions at')
print('https://pypi.org/project/Bext/')
sys.exit()
print('Rainbow 1, by Al Sweigart al@inventwithpython.com')
print(... | true | true |
f74dfd146999224e341053697d67f140a8ced0a5 | 22,955 | py | Python | ta/trend.py | havocesp/ta | 48027c4f470b58e422e089c707f05944873f4191 | [
"MIT"
] | 1 | 2019-08-21T11:02:40.000Z | 2019-08-21T11:02:40.000Z | ta/trend.py | Skaiger/ta | 938d6a9854e2f87ebb4ca3d25c74f9bda863d65e | [
"MIT"
] | null | null | null | ta/trend.py | Skaiger/ta | 938d6a9854e2f87ebb4ca3d25c74f9bda863d65e | [
"MIT"
] | 1 | 2020-04-06T04:08:40.000Z | 2020-04-06T04:08:40.000Z | # -*- coding: utf-8 -*-
"""
.. module:: trend
:synopsis: Trend Indicators.
.. moduleauthor:: Dario Lopez Padial (Bukosabino)
"""
import numpy as np
import pandas as pd
from .utils import *
def macd(close, n_fast=12, n_slow=26, fillna=False):
"""Moving Average Convergence Divergence (MACD)
Is a trend-fo... | 34.312407 | 109 | 0.635504 | import numpy as np
import pandas as pd
from .utils import *
def macd(close, n_fast=12, n_slow=26, fillna=False):
emafast = ema(close, n_fast, fillna)
emaslow = ema(close, n_slow, fillna)
macd = emafast - emaslow
if fillna:
macd = macd.replace([np.inf, -np.inf], np.nan).fillna(0)
return pd... | true | true |
f74dfe3bdbf38c63f7582c938b3d1739b9b817de | 455 | py | Python | tests/cli/test_help.py | buildntest/buildtest | d371048631cdd33ae7bf66f795f5afed83491a90 | [
"MIT"
] | 29 | 2017-10-20T02:47:10.000Z | 2020-03-26T17:24:03.000Z | tests/cli/test_help.py | shahzebsiddiqui/testgen-HPC | e69d9334cf2939af4fca59e75f397b0b1edbbfaf | [
"MIT"
] | 219 | 2017-08-25T13:21:53.000Z | 2020-04-18T19:07:05.000Z | tests/cli/test_help.py | shahzebsiddiqui/BuildTest | 5a04641f37ba588c906112b3848249b241061a9c | [
"MIT"
] | 5 | 2017-08-24T11:20:30.000Z | 2020-02-21T04:28:40.000Z | from buildtest.cli.help import buildtest_help
def test_buildtest_help():
buildtest_help(command="build")
buildtest_help(command="buildspec")
buildtest_help(command="config")
buildtest_help(command="cdash")
buildtest_help(command="history")
buildtest_help(command="inspect")
buildtest_help(c... | 30.333333 | 45 | 0.751648 | from buildtest.cli.help import buildtest_help
def test_buildtest_help():
buildtest_help(command="build")
buildtest_help(command="buildspec")
buildtest_help(command="config")
buildtest_help(command="cdash")
buildtest_help(command="history")
buildtest_help(command="inspect")
buildtest_help(c... | true | true |
f74dfeae42697ad51ca787bd426dedb9c8715794 | 9,424 | py | Python | examples/attitude.py | Stifael/uloganalysis | 70c1ae9bf0a39bc96d388cc80b90464f2edd16fa | [
"BSD-3-Clause"
] | null | null | null | examples/attitude.py | Stifael/uloganalysis | 70c1ae9bf0a39bc96d388cc80b90464f2edd16fa | [
"BSD-3-Clause"
] | null | null | null | examples/attitude.py | Stifael/uloganalysis | 70c1ae9bf0a39bc96d388cc80b90464f2edd16fa | [
"BSD-3-Clause"
] | 2 | 2018-11-02T15:41:56.000Z | 2018-11-12T15:39:23.000Z | """Create dataframe with messages required to run attitude tests.
Store topics required for attitude tests.
Add missing messages to the dataframe which are required for attitude tests.
"""
import pandas as pd
import numpy as np
import argparse
import os
import pyulog
from pyulgresample import ulogconv as conv
from py... | 30.108626 | 101 | 0.647708 | import pandas as pd
import numpy as np
import argparse
import os
import pyulog
from pyulgresample import ulogconv as conv
from pyulgresample import mathpandas as mpd
from pyulgresample import loginfo
from pyulgresample.ulogdataframe import DfUlg, TopicMsgs
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyp... | true | true |
f74dff8236a1842108f7ce75eb445a49504dd1bd | 13,667 | py | Python | models/net.py | anmatako/PatchmatchNet | 82206d8b603ec925b6e4b1990618e0ad769347de | [
"MIT"
] | null | null | null | models/net.py | anmatako/PatchmatchNet | 82206d8b603ec925b6e4b1990618e0ad769347de | [
"MIT"
] | null | null | null | models/net.py | anmatako/PatchmatchNet | 82206d8b603ec925b6e4b1990618e0ad769347de | [
"MIT"
] | null | null | null | from typing import Dict, List, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from .module import ConvBnReLU, depth_regression
from .patchmatch import PatchMatch
class FeatureNet(nn.Module):
"""Feature Extraction Network: to extract features of original images from each view"""
... | 39.845481 | 120 | 0.580376 | from typing import Dict, List, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from .module import ConvBnReLU, depth_regression
from .patchmatch import PatchMatch
class FeatureNet(nn.Module):
def __init__(self):
super(FeatureNet, self).__init__()
self.conv... | true | true |
f74dffdf2cb671be58c6730bdef13a8f3122d50a | 3,424 | py | Python | malwarebazaar/api.py | Rafiot/bazaar | ee61622de49a7ba3fa7c4c8ad07346b36e5e36e0 | [
"MIT"
] | 15 | 2021-06-16T21:25:27.000Z | 2022-02-21T10:48:32.000Z | malwarebazaar/api.py | Rafiot/bazaar | ee61622de49a7ba3fa7c4c8ad07346b36e5e36e0 | [
"MIT"
] | 3 | 2021-09-28T07:33:21.000Z | 2022-02-21T19:03:23.000Z | malwarebazaar/api.py | Rafiot/bazaar | ee61622de49a7ba3fa7c4c8ad07346b36e5e36e0 | [
"MIT"
] | 3 | 2021-06-17T20:12:54.000Z | 2022-02-21T09:31:55.000Z | from typing import Optional, Dict, Union
from requests import Session
class Bazaar:
def __init__(self, key: str):
self.session = Session()
self.session.headers.update({"API-KEY": key})
self.baseurl = "https://mb-api.abuse.ch/api/v1/"
def query_hash(self, hash: str) -> Dict:
r... | 37.217391 | 123 | 0.576227 | from typing import Optional, Dict, Union
from requests import Session
class Bazaar:
def __init__(self, key: str):
self.session = Session()
self.session.headers.update({"API-KEY": key})
self.baseurl = "https://mb-api.abuse.ch/api/v1/"
def query_hash(self, hash: str) -> Dict:
r... | true | true |
f74e008d55efbeeea6fe5304689794e20b68a33c | 5,257 | py | Python | tests/viewsets.py | NohaSayedA/dynamic-rest | ccecd4619f473c2046869722712740574165b35b | [
"MIT"
] | null | null | null | tests/viewsets.py | NohaSayedA/dynamic-rest | ccecd4619f473c2046869722712740574165b35b | [
"MIT"
] | null | null | null | tests/viewsets.py | NohaSayedA/dynamic-rest | ccecd4619f473c2046869722712740574165b35b | [
"MIT"
] | 2 | 2020-09-09T15:58:50.000Z | 2020-12-07T09:58:54.000Z | from rest_framework import exceptions
from django.db.models import Q
from dynamic_rest.viewsets import DynamicModelViewSet
from tests.models import (
Car,
Cat,
Dog,
Group,
Horse,
Location,
Permission,
Profile,
User,
Zebra
)
from tests.serializers import (
CarSerializer,
... | 27.814815 | 78 | 0.677573 | from rest_framework import exceptions
from django.db.models import Q
from dynamic_rest.viewsets import DynamicModelViewSet
from tests.models import (
Car,
Cat,
Dog,
Group,
Horse,
Location,
Permission,
Profile,
User,
Zebra
)
from tests.serializers import (
CarSerializer,
... | true | true |
f74e00d2a21e99ccd5d5003bef03dcac5f1a516d | 48,433 | py | Python | loadData.py | xygu/recourse | 7f41843056218ee5cca1921db80948a4c9848a36 | [
"MIT"
] | 19 | 2020-08-16T23:59:38.000Z | 2022-03-30T08:36:12.000Z | loadData.py | xygu/recourse | 7f41843056218ee5cca1921db80948a4c9848a36 | [
"MIT"
] | 4 | 2021-04-30T21:24:44.000Z | 2022-03-12T00:46:45.000Z | loadData.py | xygu/recourse | 7f41843056218ee5cca1921db80948a4c9848a36 | [
"MIT"
] | 6 | 2020-08-16T23:59:39.000Z | 2022-01-31T11:15:17.000Z | import os
import sys
import copy
import pickle
import numpy as np
import pandas as pd
from tqdm import tqdm
from pprint import pprint
from sklearn.model_selection import train_test_split
import utils
from debug import ipsh
sys.path.insert(0, '_data_main')
try:
from _data_main.fair_adult_data import *
except:
pri... | 38.377971 | 142 | 0.680053 | import os
import sys
import copy
import pickle
import numpy as np
import pandas as pd
from tqdm import tqdm
from pprint import pprint
from sklearn.model_selection import train_test_split
import utils
from debug import ipsh
sys.path.insert(0, '_data_main')
try:
from _data_main.fair_adult_data import *
except:
pri... | true | true |
f74e00f69227f2f2032cfd1d37e967e9da274ebb | 6,142 | py | Python | designate/tests/unit/agent/backends/test_denominator.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 145 | 2015-01-02T09:35:53.000Z | 2021-12-14T17:03:53.000Z | designate/tests/unit/agent/backends/test_denominator.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 6 | 2015-03-15T00:22:27.000Z | 2019-12-16T09:37:38.000Z | designate/tests/unit/agent/backends/test_denominator.py | mrlesmithjr/designate | bff3d5f6e31fe595a77143ec4ac779c187bf72a8 | [
"Apache-2.0"
] | 109 | 2015-01-13T16:47:34.000Z | 2021-03-15T13:18:48.000Z | # Copyright 2015 Dyn Inc.
#
# Author: Yasha Bubnov <ybubnov@dyn.com>
#
# 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.343195 | 79 | 0.651579 | from unittest import mock
from oslo_config import cfg
from designate.backend.agent_backend import impl_denominator
from designate import exceptions
from designate import tests
from designate.tests.unit.agent import backends
from designate import utils
class DenominatorAgentBackendTestCase(tests.TestCase):
def s... | true | true |
f74e01b5cadcf57c4832f127cbc4531006d4f3c3 | 355 | py | Python | thonny/vendored_libs/pipkin/common.py | kr-g/thonny | 8aec29b6920482ba131bb03aab36ae2765e17d0d | [
"MIT"
] | 8 | 2022-03-15T18:01:46.000Z | 2022-03-26T19:52:01.000Z | pipkin/common.py | aivarannamaa/pipkin | f42e4004d82fb6a71b541b411b1366c72396aba4 | [
"MIT"
] | null | null | null | pipkin/common.py | aivarannamaa/pipkin | f42e4004d82fb6a71b541b411b1366c72396aba4 | [
"MIT"
] | null | null | null | class UserError(RuntimeError):
pass
class CommunicationError(RuntimeError):
pass
class ProtocolError(RuntimeError):
pass
class ManagementError(ProtocolError):
def __init__(self, msg: str, script: str, out: str, err: str):
super().__init__(self, msg)
self.script = script
sel... | 18.684211 | 66 | 0.659155 | class UserError(RuntimeError):
pass
class CommunicationError(RuntimeError):
pass
class ProtocolError(RuntimeError):
pass
class ManagementError(ProtocolError):
def __init__(self, msg: str, script: str, out: str, err: str):
super().__init__(self, msg)
self.script = script
sel... | true | true |
f74e0200adbfb470ed10ccb5f8fb109eef363145 | 2,430 | py | Python | posthog/test/test_team.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-04-09T09:13:23.000Z | 2021-04-09T09:13:23.000Z | posthog/test/test_team.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-10-13T10:05:26.000Z | 2021-10-13T10:05:26.000Z | posthog/test/test_team.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | 1 | 2021-09-16T18:18:07.000Z | 2021-09-16T18:18:07.000Z | import random
from unittest import mock
from django.conf import settings
from posthog.models import EventDefinition, Organization, PluginConfig, PropertyDefinition, Team, User
from posthog.plugins.test.mock import mocked_plugin_requests_get
from .base import BaseTest
class TestTeam(BaseTest):
def test_team_has... | 40.5 | 120 | 0.620165 | import random
from unittest import mock
from django.conf import settings
from posthog.models import EventDefinition, Organization, PluginConfig, PropertyDefinition, Team, User
from posthog.plugins.test.mock import mocked_plugin_requests_get
from .base import BaseTest
class TestTeam(BaseTest):
def test_team_has... | true | true |
f74e029c4caf25e9dc13436f85aa2639f703a61e | 1,629 | py | Python | itez/authentication/forms.py | Olipa776/itez | d6bba80c74d5ce385ae8a304e56546d927d24624 | [
"MIT"
] | 1 | 2021-12-12T11:46:47.000Z | 2021-12-12T11:46:47.000Z | itez/authentication/forms.py | Olipa776/itez | d6bba80c74d5ce385ae8a304e56546d927d24624 | [
"MIT"
] | 11 | 2021-11-03T10:46:00.000Z | 2021-12-20T11:35:00.000Z | itez/authentication/forms.py | Olipa776/itez | d6bba80c74d5ce385ae8a304e56546d927d24624 | [
"MIT"
] | 7 | 2021-11-01T15:03:02.000Z | 2021-11-06T13:06:10.000Z | # -*- encoding: utf-8 -*-
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
class LoginForm(forms.Form):
username = forms.CharField(
widget=forms.TextInput(
attrs={... | 27.610169 | 86 | 0.589319 |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.utils.translation import gettext_lazy as _
class LoginForm(forms.Form):
username = forms.CharField(
widget=forms.TextInput(
attrs={"placeholder": "Username",... | true | true |
f74e02b2dbde46fa2ccd38f59d7412221932d815 | 428 | py | Python | 1-Easy/isBalanced.py | Sma-Das/Leetcode | 6f9b8f069e2ef198408abd6780fd0697a8bebada | [
"MIT"
] | null | null | null | 1-Easy/isBalanced.py | Sma-Das/Leetcode | 6f9b8f069e2ef198408abd6780fd0697a8bebada | [
"MIT"
] | null | null | null | 1-Easy/isBalanced.py | Sma-Das/Leetcode | 6f9b8f069e2ef198408abd6780fd0697a8bebada | [
"MIT"
] | null | null | null | class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
def isBalanced(root: TreeNode) -> bool:
def check(root):
if not root:
return 0
l, r = check(root.left), check(root.right)
if -1 in [... | 22.526316 | 53 | 0.523364 | class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
def isBalanced(root: TreeNode) -> bool:
def check(root):
if not root:
return 0
l, r = check(root.left), check(root.right)
if -1 in [... | true | true |
f74e03b8363ddea47dc3c16b1fcc810d67607200 | 1,890 | py | Python | compmech/panel/tests/test_panel_field_outputs.py | mrosemeier/compmech | f18f6d0471c72b26a3b014d2df41df3463505eae | [
"BSD-3-Clause"
] | 4 | 2019-02-05T06:12:12.000Z | 2022-03-25T14:41:18.000Z | compmech/panel/tests/test_panel_field_outputs.py | mrosemeier/compmech | f18f6d0471c72b26a3b014d2df41df3463505eae | [
"BSD-3-Clause"
] | null | null | null | compmech/panel/tests/test_panel_field_outputs.py | mrosemeier/compmech | f18f6d0471c72b26a3b014d2df41df3463505eae | [
"BSD-3-Clause"
] | 2 | 2019-06-05T07:19:35.000Z | 2020-12-29T00:22:18.000Z | import numpy as np
from compmech.panel import Panel
from compmech.analysis import Analysis
from compmech.sparse import solve
def test_panel_field_outputs():
m = 7
n = 6
#TODO implement for conical panels
strain_field = dict(exx=None, eyy=None, gxy=None, kxx=None, kyy=None, kxy=None)
stress_field =... | 31.5 | 83 | 0.513757 | import numpy as np
from compmech.panel import Panel
from compmech.analysis import Analysis
from compmech.sparse import solve
def test_panel_field_outputs():
m = 7
n = 6
strain_field = dict(exx=None, eyy=None, gxy=None, kxx=None, kyy=None, kxy=None)
stress_field = dict(Nxx=None, Nyy=None, Nxy=None,... | true | true |
f74e03ff57d598a2670998e719066886c456cdf5 | 3,068 | py | Python | internal/notes/builtin-SAVE/packages/geos/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/geos/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/geos/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 43.211268 | 78 | 0.667862 | from spack import *
class Geos(Package):
homepage = "http://trac.osgeo.org/geos/"
url = "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2"
version('3.5.0', '136842690be7f504fba46b3c539438dd')
version('3.4.2', 'fc5df2d926eb7e67f988a43a92683bae')
version('3.4.1', '4c930dec44c45c49cd... | true | true |
f74e04d9f9df95359318764a3a89c26c9200db14 | 13,264 | py | Python | mystic/penguin.py | RykerCohen/mystic | 5f60e43642e21f13068cc9a755712f240038fa48 | [
"MIT"
] | 2 | 2020-11-06T02:27:57.000Z | 2020-11-06T08:22:06.000Z | mystic/penguin.py | RykerCohen/mystic | 5f60e43642e21f13068cc9a755712f240038fa48 | [
"MIT"
] | 16 | 2020-11-06T05:13:39.000Z | 2020-11-08T03:23:29.000Z | mystic/penguin.py | RykerCohen/mystic | 5f60e43642e21f13068cc9a755712f240038fa48 | [
"MIT"
] | 3 | 2020-11-06T17:13:29.000Z | 2020-11-25T16:17:30.000Z | import time
from mystic.data import penguin
from mystic.data.mail import PenguinPostcard
from mystic.handlers.play.pet import get_my_player_walking_puffle
from mystic.spheniscidae import Spheniscidae
class Penguin(Spheniscidae, penguin.Penguin):
__slots__ = (
'x', 'y',
'frame',
'toy',
... | 34.185567 | 109 | 0.62221 | import time
from mystic.data import penguin
from mystic.data.mail import PenguinPostcard
from mystic.handlers.play.pet import get_my_player_walking_puffle
from mystic.spheniscidae import Spheniscidae
class Penguin(Spheniscidae, penguin.Penguin):
__slots__ = (
'x', 'y',
'frame',
'toy',
... | true | true |
f74e05566409c32ea0af76486bd264029a9acd38 | 1,557 | py | Python | configs_hsi/swin-spectral-gan/upernet_swinspectral_small_patch4_window7_token_4k_hsioasisvgg.py | dkswxd/nnUnet-HSI | 9053bfeece43eda2be9ef679153e600906802548 | [
"Apache-2.0"
] | null | null | null | configs_hsi/swin-spectral-gan/upernet_swinspectral_small_patch4_window7_token_4k_hsioasisvgg.py | dkswxd/nnUnet-HSI | 9053bfeece43eda2be9ef679153e600906802548 | [
"Apache-2.0"
] | null | null | null | configs_hsi/swin-spectral-gan/upernet_swinspectral_small_patch4_window7_token_4k_hsioasisvgg.py | dkswxd/nnUnet-HSI | 9053bfeece43eda2be9ef679153e600906802548 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../_base_/models/upernet_swinspectral.py', '../_base_/datasets/hsixoasissvgg.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_4k.py'
]
norm_cfg = dict(type='BN', requires_grad=True)
model = dict(
backbone=dict(
embed_dims=96,
depths=[2, 2, 18, 2],
num_he... | 26.844828 | 86 | 0.601798 | _base_ = [
'../_base_/models/upernet_swinspectral.py', '../_base_/datasets/hsixoasissvgg.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_4k.py'
]
norm_cfg = dict(type='BN', requires_grad=True)
model = dict(
backbone=dict(
embed_dims=96,
depths=[2, 2, 18, 2],
num_he... | true | true |
f74e0638c74e73f370eab82ff1ee1f40c71802a0 | 472 | py | Python | python/robot-name/robot.py | rootulp/exercism | 312a053ad1d375752acf0fce062ee7b9c643a149 | [
"MIT"
] | 41 | 2015-02-09T18:08:45.000Z | 2022-03-06T15:23:32.000Z | python/robot-name/robot.py | DucChuyenSoftwareEngineer/exercism | fb7820a1ba162b888a39f1b86cbe5d3ca3b15d4f | [
"MIT"
] | 21 | 2019-12-28T17:47:06.000Z | 2021-02-27T19:43:00.000Z | python/robot-name/robot.py | DucChuyenSoftwareEngineer/exercism | fb7820a1ba162b888a39f1b86cbe5d3ca3b15d4f | [
"MIT"
] | 18 | 2016-04-29T14:35:12.000Z | 2021-06-23T07:32:29.000Z | import string
import random
class Robot:
def __init__(self):
self.name = self.generate_name()
def reset(self):
self.name = self.generate_name()
def generate_name(self):
random.seed()
return self.random_prefix(2) + self.random_suffix(3)
def random_prefix(self, n):
... | 21.454545 | 64 | 0.644068 | import string
import random
class Robot:
def __init__(self):
self.name = self.generate_name()
def reset(self):
self.name = self.generate_name()
def generate_name(self):
random.seed()
return self.random_prefix(2) + self.random_suffix(3)
def random_prefix(self, n):
... | true | true |
f74e07306dfd2e01c69ce0c56d37bec369d6da9f | 490 | py | Python | data/scripts/templates/object/tangible/ship/components/booster/shared_bst_koensayr_racer_mk2.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/ship/components/booster/shared_bst_koensayr_racer_mk2.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/ship/components/booster/shared_bst_koensayr_racer_mk2.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/booster/shared_bst_koensayr_racer_mk2.iff"
result.a... | 28.823529 | 94 | 0.746939 |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/booster/shared_bst_koensayr_racer_mk2.iff"
result.attribute_template_id = 8
result.stfName("space/space_item","bst_koensayr_racer_mk2_n")
return result | true | true |
f74e08e4c8d1d1fe496413d1edcd2c47c6720d19 | 1,230 | py | Python | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 9 | 2021-12-07T07:52:28.000Z | 2022-03-23T10:26:25.000Z | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 71 | 2021-12-03T09:40:56.000Z | 2022-03-29T21:47:38.000Z | cvrf2csaf/section_handlers/document_publisher.py | sthagen/csaf-tools-CVRF-CSAF-Converter | bc458eb1a71cf12c5a7c45223b56ab233819bdbd | [
"Apache-2.0",
"MIT"
] | 3 | 2021-12-07T07:52:32.000Z | 2022-02-17T09:55:00.000Z | """ Module containing DocumentPublisher class """
from ..common.common import SectionHandler
# pylint: disable=too-few-public-methods
class DocumentPublisher(SectionHandler):
""" Responsible for converting the DocumentPublisher section:
- /cvrf:cvrfdoc/cvrf:DocumentPublisher
"""
type_category_mappi... | 36.176471 | 87 | 0.669919 | from ..common.common import SectionHandler
class DocumentPublisher(SectionHandler):
type_category_mapping = {
'Vendor': 'vendor',
'Coordinator': 'coordinator',
'User': 'user',
'Discoverer': 'discoverer',
'Other': 'other',
}
def __init__(self, config):
super... | true | true |
f74e093ac8f666b7345395041c0e414fb1c24bf8 | 1,579 | py | Python | setup.py | jml/trial-eliot | df39f498d012d05bb70a19d80adab40e1993f3a2 | [
"Apache-2.0"
] | null | null | null | setup.py | jml/trial-eliot | df39f498d012d05bb70a19d80adab40e1993f3a2 | [
"Apache-2.0"
] | 1 | 2016-03-05T03:47:07.000Z | 2016-03-05T10:45:24.000Z | setup.py | jml/trial-eliot | df39f498d012d05bb70a19d80adab40e1993f3a2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2015 Jonathan M. Lange <jml@mumak.net>
#
# 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 re... | 29.792453 | 74 | 0.643445 |
from setuptools import setup, find_packages
setup(
name="trial-eliot",
version="0.1.0",
description="Eliot reporter for Trial.",
author="Jonathan Lange",
author_email="jml@mumak.net",
install_requires=[
'eliot',
'pyrsistent',
'toolz',
'Twisted',
'zope.i... | true | true |
f74e0a0a4e0106cfc2b235d0d307badc60e05e10 | 5,504 | py | Python | Hypothesis_testing/HypothesisTesting1.py | kunalk3/Machine_Learning_using_Python | 6a70e66151dc8358c429be71ebbf3fbc19479847 | [
"MIT"
] | null | null | null | Hypothesis_testing/HypothesisTesting1.py | kunalk3/Machine_Learning_using_Python | 6a70e66151dc8358c429be71ebbf3fbc19479847 | [
"MIT"
] | null | null | null | Hypothesis_testing/HypothesisTesting1.py | kunalk3/Machine_Learning_using_Python | 6a70e66151dc8358c429be71ebbf3fbc19479847 | [
"MIT"
] | null | null | null | #---------------------------------------------------------------------
# File Name : HypothesisTesting1.py
# Author : Kunal K.
# Description : Implementing hypothesis test methods
# Date: : 9 Nov. 2020
# Version : V1.0
# Ref No : DS_Code_P_K07
#-----------------------------------------------------... | 36.693333 | 98 | 0.701853 |
import pandas as pd
import numpy as np
import scipy
from scipy import stats
import statsmodels.api as sm
import plotly.plotly as py
import plotly.graph_objs as go
from plotly.tools import FigureFactory as FF
data=pd.read_csv("Hypothesis testing/with and without additive.csv")
withoutAdditive_data=stats.shapiro(dat... | true | true |
f74e0a1ab31641592e630d6b23490fc0f252a26a | 2,360 | py | Python | kubee2etests/statussender.py | RoseTeague/kube-e2etestapp | 210808bcdc585005d59a2fac9223c6a2125931de | [
"Apache-2.0"
] | 3 | 2018-04-10T13:03:10.000Z | 2020-02-15T07:03:35.000Z | kubee2etests/statussender.py | RoseTeague/kube-e2etestapp | 210808bcdc585005d59a2fac9223c6a2125931de | [
"Apache-2.0"
] | 10 | 2018-04-12T13:10:01.000Z | 2019-05-03T14:21:49.000Z | kubee2etests/statussender.py | RoseTeague/kube-e2etestapp | 210808bcdc585005d59a2fac9223c6a2125931de | [
"Apache-2.0"
] | 3 | 2018-04-19T13:46:59.000Z | 2019-02-26T17:22:32.000Z | import logging
import requests
import os
import copy
from kubee2etests.helpers_and_globals import TEST_NAMESPACE, FLASK_PORT, StatusEvent
LOGGER = logging.getLogger(__name__)
class StatusSender(object):
def __init__(self):
self.errors = []
@property
def results(self):
passed = len(self.er... | 33.714286 | 135 | 0.614407 | import logging
import requests
import os
import copy
from kubee2etests.helpers_and_globals import TEST_NAMESPACE, FLASK_PORT, StatusEvent
LOGGER = logging.getLogger(__name__)
class StatusSender(object):
def __init__(self):
self.errors = []
@property
def results(self):
passed = len(self.er... | true | true |
f74e0b9609f8848361eddcef2066c03952319938 | 8,413 | py | Python | docs/conf.py | justindalzell/webapp2 | 90e444b4d643f3dccaaf6653e717161871c7cc05 | [
"Apache-2.0"
] | 157 | 2016-04-08T21:10:41.000Z | 2021-12-30T13:47:30.000Z | docs/conf.py | justindalzell/webapp2 | 90e444b4d643f3dccaaf6653e717161871c7cc05 | [
"Apache-2.0"
] | 57 | 2016-04-08T20:26:50.000Z | 2021-03-20T05:47:28.000Z | docs/conf.py | justindalzell/webapp2 | 90e444b4d643f3dccaaf6653e717161871c7cc05 | [
"Apache-2.0"
] | 74 | 2016-04-11T02:08:53.000Z | 2022-01-19T18:10:19.000Z | # -*- coding: utf-8 -*-
#
# webapp2 documentation build configuration file, created by
# sphinx-quickstart on Sat Jul 31 10:41:37 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 31.74717 | 149 | 0.718531 | import mock
import os
import sys
from pkg_resources import get_distribution
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
class Mock(mock.Mock):
@classmethod
def __getattr__(cls, name):
return Mock()
MOCK_MODULES = (
'google',
'google.appengine',
'google.appengine.api',
... | true | true |
f74e0c36f3bb1530c5b22a1bfb2a8c8822a11877 | 5,273 | py | Python | AT88CK590/fw/LibraryExamples/SHA204/AvrStudio5/engr_10490/test/python/src/aaspi_slave.py | Wintekso/CryptoAuth-explorations | b0f7ec0363f5379f3d971e647c0806cfcb08d5f0 | [
"Apache-2.0"
] | 15 | 2017-06-22T23:14:20.000Z | 2021-04-05T18:53:09.000Z | AT88CK590/fw/LibraryExamples/SHA204/AvrStudio5/engr_10490/test/python/src/aaspi_slave.py | Wintekso/CryptoAuth-explorations | b0f7ec0363f5379f3d971e647c0806cfcb08d5f0 | [
"Apache-2.0"
] | 2 | 2017-09-15T05:12:51.000Z | 2017-09-15T18:56:15.000Z | AT88CK590/fw/LibraryExamples/SHA204/AvrStudio5/engr_10490/test/python/src/aaspi_slave.py | Wintekso/CryptoAuth-explorations | b0f7ec0363f5379f3d971e647c0806cfcb08d5f0 | [
"Apache-2.0"
] | 3 | 2017-06-23T10:51:53.000Z | 2020-05-28T00:56:12.000Z | #!/bin/env python
#==========================================================================
# (c) 2004 Total Phase, Inc.
#--------------------------------------------------------------------------
# Project : Aardvark Sample Code
# File : aaspi_slave.py
#-----------------------------------------------------... | 36.618056 | 76 | 0.51887 |
import sys
from aardvark_py import *
BUFFER_SIZE = 65535
SLAVE_RESP_SIZE = 26
def dump (handle, timeout_ms):
print "Watching slave SPI data..."
result = aa_async_poll(handle, timeout_ms)
if (result != AA_ASYNC_SPI):
print "No data available."
return
... | false | true |
f74e0e2b17724fba0711c269b1f2174b0fae151d | 5,471 | py | Python | nova/virt/ironic/client_wrapper.py | bopopescu/calico-nova | d01a4e54df558092702ffeae3cb4551bfb2d7707 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/virt/ironic/client_wrapper.py | bopopescu/calico-nova | d01a4e54df558092702ffeae3cb4551bfb2d7707 | [
"Apache-2.0"
] | 2 | 2015-09-07T22:14:46.000Z | 2020-08-12T08:51:56.000Z | nova/virt/ironic/client_wrapper.py | bopopescu/calico-nova | d01a4e54df558092702ffeae3cb4551bfb2d7707 | [
"Apache-2.0"
] | 4 | 2015-09-09T16:48:56.000Z | 2022-03-15T20:52:57.000Z | # coding=utf-8
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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/l... | 37.731034 | 79 | 0.603729 |
import time
from oslo.config import cfg
from oslo.utils import importutils
from nova import exception
from nova.i18n import _
from nova.openstack.common import log as logging
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
ironic = None
class IronicClientWrapper(object):
def __init__(self):
globa... | true | true |
f74e0e629aec50bec16ad0b09b1caa6c5c659287 | 30,987 | py | Python | indicators.py | cofibit/bitmexbot | 765ec4efaf710b334b0c9f20a094d003261c297f | [
"MIT"
] | 15 | 2018-10-01T15:33:12.000Z | 2021-02-13T00:46:06.000Z | indicators.py | cofibit/mexbot | 765ec4efaf710b334b0c9f20a094d003261c297f | [
"MIT"
] | 1 | 2020-05-07T09:10:19.000Z | 2020-05-07T09:10:19.000Z | indicators.py | cofibit/mexbot | 765ec4efaf710b334b0c9f20a094d003261c297f | [
"MIT"
] | 6 | 2018-12-25T12:01:09.000Z | 2020-02-11T13:54:22.000Z | """
This file contains a collection of common indicators, which are based on third party or custom libraries
"""
from numpy.core.records import ndarray
from pandas import Series, DataFrame
import pandas as pd
import numpy as np
# from math import log
def heikinashi(bars):
bars = bars.copy()
bars... | 36.889286 | 156 | 0.579372 | from numpy.core.records import ndarray
from pandas import Series, DataFrame
import pandas as pd
import numpy as np
def heikinashi(bars):
bars = bars.copy()
bars['ha_close'] = (bars['open'] + bars['high'] +
bars['low'] + bars['close']) / 4
bars['ha_open'] = (bars['open']... | true | true |
f74e0fd8dc1dee03a2256f09936b3aef979e0eac | 563 | py | Python | docker/src/clawpack-5.3.1/pyclaw/development/point_wise_rs/pyWrapperForRiemannSolver/riemannSolverDemo.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 11 | 2017-01-04T18:19:48.000Z | 2021-02-21T01:46:33.000Z | docker/src/clawpack-5.3.1/pyclaw/development/point_wise_rs/pyWrapperForRiemannSolver/riemannSolverDemo.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 8 | 2016-09-22T20:49:51.000Z | 2019-09-06T23:28:13.000Z | docker/src/clawpack-5.3.1/pyclaw/development/point_wise_rs/pyWrapperForRiemannSolver/riemannSolverDemo.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 13 | 2016-09-22T20:20:06.000Z | 2020-07-13T14:48:32.000Z |
import RiemannSolver
from RiemannSolver import *
from pylab import plot, figure, suptitle
rs = RiemannSolver(timeSteps =1, mwaves = 2, mx = 800, meqn = 2, maux = 2)
rs.q = random.random((rs.meqn,rs.mx))
rs.aux = random.random((rs.maux,rs.mx))
waves1, s1 = rs.solveVectorized(timer = True)
waves2, s2 = rs.solve... | 26.809524 | 125 | 0.712256 |
import RiemannSolver
from RiemannSolver import *
from pylab import plot, figure, suptitle
rs = RiemannSolver(timeSteps =1, mwaves = 2, mx = 800, meqn = 2, maux = 2)
rs.q = random.random((rs.meqn,rs.mx))
rs.aux = random.random((rs.maux,rs.mx))
waves1, s1 = rs.solveVectorized(timer = True)
waves2, s2 = rs.solve... | true | true |
f74e10e92d0c36df71042fbc0401a354373fca00 | 224 | py | Python | lib/pylint/test/functional/duplicate_dict_literal_key.py | willemneal/Docky | d3504e1671b4a6557468234c263950bfab461ce4 | [
"MIT"
] | 3 | 2018-11-25T01:09:55.000Z | 2021-08-24T01:56:36.000Z | lib/pylint/test/functional/duplicate_dict_literal_key.py | willemneal/Docky | d3504e1671b4a6557468234c263950bfab461ce4 | [
"MIT"
] | 1 | 2019-01-17T14:26:22.000Z | 2019-01-17T22:56:26.000Z | lib/pylint/test/functional/duplicate_dict_literal_key.py | willemneal/Docky | d3504e1671b4a6557468234c263950bfab461ce4 | [
"MIT"
] | 3 | 2018-11-09T03:38:09.000Z | 2020-02-24T06:26:10.000Z | """Check multiple key definition"""
#pylint: disable=C0103
correct_dict = {
'tea': 'for two',
'two': 'for tea',
}
wrong_dict = { # [duplicate-key]
'tea': 'for two',
'two': 'for tea',
'tea': 'time',
}
| 14.933333 | 35 | 0.540179 |
correct_dict = {
'tea': 'for two',
'two': 'for tea',
}
wrong_dict = { 'tea': 'for two',
'two': 'for tea',
'tea': 'time',
}
| true | true |
f74e11ec6c15601478ed1fc47062c89f5ecc7fbf | 14,258 | py | Python | spyre/spyre/spyrelets/twopulsephotonecho_spyrelet.py | zhong-lab/optics | 9de1942d9a128183ecb3d360b160b27126e7b8f0 | [
"BSD-2-Clause"
] | 1 | 2022-03-27T07:47:19.000Z | 2022-03-27T07:47:19.000Z | spyre/spyre/spyrelets/twopulsephotonecho_spyrelet.py | zhong-lab/optics | 9de1942d9a128183ecb3d360b160b27126e7b8f0 | [
"BSD-2-Clause"
] | null | null | null | spyre/spyre/spyrelets/twopulsephotonecho_spyrelet.py | zhong-lab/optics | 9de1942d9a128183ecb3d360b160b27126e7b8f0 | [
"BSD-2-Clause"
] | 4 | 2019-11-08T22:39:04.000Z | 2021-11-05T02:39:37.000Z | import numpy as np
import pyqtgraph as pg
import time
import csv
import os
from PyQt5.Qsci import QsciScintilla, QsciLexerPython
import matplotlib.pyplot as plt
from spyre import Spyrelet, Task, Element
from spyre.widgets.task import TaskWidget
from spyre.plotting import LinePlotWidget
from spyre.widgets.rangespace i... | 32.852535 | 122 | 0.70094 | import numpy as np
import pyqtgraph as pg
import time
import csv
import os
from PyQt5.Qsci import QsciScintilla, QsciLexerPython
import matplotlib.pyplot as plt
from spyre import Spyrelet, Task, Element
from spyre.widgets.task import TaskWidget
from spyre.plotting import LinePlotWidget
from spyre.widgets.rangespace i... | true | true |
f74e124743623795e07a2cd867df1e462f0aefd8 | 421 | py | Python | Classification/LogisticModel.py | govindansriram/CobraML | d231d2e446df7e7860071f5d7cfa1e31afa99c6b | [
"BSD-3-Clause"
] | 15 | 2021-07-21T20:54:39.000Z | 2021-09-03T02:54:46.000Z | Classification/LogisticModel.py | govindansriram/CobraML | d231d2e446df7e7860071f5d7cfa1e31afa99c6b | [
"BSD-3-Clause"
] | 3 | 2021-08-30T03:10:06.000Z | 2021-10-05T19:40:34.000Z | Classification/LogisticModel.py | govindansriram/CobraML | d231d2e446df7e7860071f5d7cfa1e31afa99c6b | [
"BSD-3-Clause"
] | 1 | 2022-02-20T13:51:31.000Z | 2022-02-20T13:51:31.000Z | from torch import nn
import torch
class LogisticRegression(nn.Module):
def __init__(self,
theta_params: int):
super(LogisticRegression, self).__init__()
self.__linear = nn.Linear(theta_params, 1)
self.__sigmoid_layer = nn.Sigmoid()
def forward(self,
... | 23.388889 | 59 | 0.646081 | from torch import nn
import torch
class LogisticRegression(nn.Module):
def __init__(self,
theta_params: int):
super(LogisticRegression, self).__init__()
self.__linear = nn.Linear(theta_params, 1)
self.__sigmoid_layer = nn.Sigmoid()
def forward(self,
... | true | true |
f74e1289e792f79bc803737b798a07701c3c72eb | 548 | py | Python | p10_binary_hex_conv.py | Muneeb97/Python | 3d8e78268e6e09f25f43b1d119aa54129e979da4 | [
"MIT"
] | null | null | null | p10_binary_hex_conv.py | Muneeb97/Python | 3d8e78268e6e09f25f43b1d119aa54129e979da4 | [
"MIT"
] | null | null | null | p10_binary_hex_conv.py | Muneeb97/Python | 3d8e78268e6e09f25f43b1d119aa54129e979da4 | [
"MIT"
] | null | null | null | #convert numbers to binary and hex upto a certain number
print('decimal to binary/hex converter')
num1 = int(input('To which number shall values be converted: '))
lst_b = []
lst_h = []
for i in range(1,num1+1):
#print(i,' ',bin(i))
lst_b.append(bin(i))
for i in range(1,num1+1):
#print(i,' ',hex(i... | 34.25 | 65 | 0.625912 | print('decimal to binary/hex converter')
num1 = int(input('To which number shall values be converted: '))
lst_b = []
lst_h = []
for i in range(1,num1+1):
lst_b.append(bin(i))
for i in range(1,num1+1):
lst_h.append(hex(i))
r1 = int(input('what decimal value would you like to start: '))
r2 = int(... | true | true |
f74e147cd33e14ff660514dc037807a49fd642d4 | 13,130 | bzl | Python | bazel/repositories.bzl | sridmad/envoy | a30a8b794757a97886252ee9f7646a19a0605f53 | [
"Apache-2.0"
] | null | null | null | bazel/repositories.bzl | sridmad/envoy | a30a8b794757a97886252ee9f7646a19a0605f53 | [
"Apache-2.0"
] | null | null | null | bazel/repositories.bzl | sridmad/envoy | a30a8b794757a97886252ee9f7646a19a0605f53 | [
"Apache-2.0"
] | null | null | null | load(
"@bazel_tools//tools/build_defs/repo:git.bzl",
"git_repository",
"new_git_repository",
)
load(":genrule_repository.bzl", "genrule_repository")
load(":patched_http_archive.bzl", "patched_http_archive")
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS")
load(":target_recipes.bzl", "TARGET_RECIPES... | 31.714976 | 128 | 0.62003 | load(
"@bazel_tools//tools/build_defs/repo:git.bzl",
"git_repository",
"new_git_repository",
)
load(":genrule_repository.bzl", "genrule_repository")
load(":patched_http_archive.bzl", "patched_http_archive")
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS")
load(":target_recipes.bzl", "TARGET_RECIPES... | true | true |
f74e14d7c5ee98506891e2e06f737af8ac1e1634 | 3,623 | py | Python | kelly/fractional.py | octonion/betting | d3be4dc3c3d2f5aa77006e5c9f388c1b79414efb | [
"MIT"
] | 26 | 2017-04-03T01:45:27.000Z | 2021-09-22T12:11:31.000Z | kelly/fractional.py | octonion/betting | d3be4dc3c3d2f5aa77006e5c9f388c1b79414efb | [
"MIT"
] | null | null | null | kelly/fractional.py | octonion/betting | d3be4dc3c3d2f5aa77006e5c9f388c1b79414efb | [
"MIT"
] | 7 | 2017-04-07T17:42:23.000Z | 2021-12-21T21:58:22.000Z | #!/usr/bin/env python3
import csv
import sys
import numpy as np
import pandas as pd
csv_name = sys.argv[1]
fraction = float(sys.argv[2])
with open(sys.argv[1], 'r') as f:
csv = csv.reader(f)
for p in csv:
ip = next(csv)
m = int(p[0])
# Our probabilities
p = ... | 28.753968 | 150 | 0.485233 |
import csv
import sys
import numpy as np
import pandas as pd
csv_name = sys.argv[1]
fraction = float(sys.argv[2])
with open(sys.argv[1], 'r') as f:
csv = csv.reader(f)
for p in csv:
ip = next(csv)
m = int(p[0])
p = np.array([float(i) for i in p[1:]])
... | true | true |
f74e1526277516210ff8bf1e85b3cd164da6f563 | 11,604 | py | Python | splunk_add_on_ucc_framework/modular_alert_builder/build_core/alert_actions_helper.py | splunk/addonfactory-ucc-generator | 5031177cbba7ca4b41218aa5b5efb92ec0822b7f | [
"Apache-2.0"
] | 16 | 2020-10-27T18:51:23.000Z | 2022-03-15T10:01:51.000Z | splunk_add_on_ucc_framework/modular_alert_builder/build_core/alert_actions_helper.py | splunk/addonfactory-ucc-generator | 5031177cbba7ca4b41218aa5b5efb92ec0822b7f | [
"Apache-2.0"
] | 375 | 2020-09-19T13:03:00.000Z | 2022-03-31T17:12:24.000Z | splunk_add_on_ucc_framework/modular_alert_builder/build_core/alert_actions_helper.py | splunk/addonfactory-ucc-generator | 5031177cbba7ca4b41218aa5b5efb92ec0822b7f | [
"Apache-2.0"
] | 11 | 2021-01-02T03:25:00.000Z | 2022-03-16T15:50:49.000Z | #
# Copyright 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 28.937656 | 86 | 0.521544 |
import os.path as op
import sys
from os import makedirs, remove
from splunk_add_on_ucc_framework import conf_parser
from .alert_actions_merge import merge_conf_file
def write_file(file_name, file_path, content, logger, merge="stanza_overwrite"):
logger.debug('operation="write", object="%s" object_type="file"'... | true | true |
f74e1527587ef269dbc73f8c4099e30992a68b6d | 2,176 | py | Python | openapi_core/schema/responses/generators.py | eyadgaran/openapi-core | ff4a6c81eeda0e2274aa9dc03597779c141e5728 | [
"BSD-3-Clause"
] | null | null | null | openapi_core/schema/responses/generators.py | eyadgaran/openapi-core | ff4a6c81eeda0e2274aa9dc03597779c141e5728 | [
"BSD-3-Clause"
] | null | null | null | openapi_core/schema/responses/generators.py | eyadgaran/openapi-core | ff4a6c81eeda0e2274aa9dc03597779c141e5728 | [
"BSD-3-Clause"
] | 1 | 2022-01-19T21:23:56.000Z | 2022-01-19T21:23:56.000Z | """OpenAPI core responses generators module"""
from six import iteritems
from openapi_core.compat import lru_cache
from openapi_core.schema.extensions.generators import ExtensionsGenerator
from openapi_core.schema.links.generators import LinksGenerator
from openapi_core.schema.media_types.generators import MediaTypeGe... | 35.096774 | 76 | 0.703585 | from six import iteritems
from openapi_core.compat import lru_cache
from openapi_core.schema.extensions.generators import ExtensionsGenerator
from openapi_core.schema.links.generators import LinksGenerator
from openapi_core.schema.media_types.generators import MediaTypeGenerator
from openapi_core.schema.parameters.gen... | true | true |
f74e1b22bbcb6f2a083ddc68784587e7036dbd86 | 6,721 | py | Python | test/util/bitcoin-util-test.py | Kozisto/netbox | e6e0897a31e094323797fb67b132254dba97f8b6 | [
"MIT"
] | 110 | 2019-07-12T11:46:31.000Z | 2022-02-18T19:47:23.000Z | test/util/bitcoin-util-test.py | hoangcon12345/Netbox.Wallet | 321d83280d832be64c4afdd35eaace713df92289 | [
"MIT"
] | 2 | 2019-09-27T05:43:59.000Z | 2021-09-04T08:39:16.000Z | test/util/bitcoin-util-test.py | hoangcon12345/Netbox.Wallet | 321d83280d832be64c4afdd35eaace713df92289 | [
"MIT"
] | 28 | 2019-07-12T13:38:38.000Z | 2022-03-23T19:37:08.000Z | #!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 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 framework for pivx utils.
Runs automatically during `make check`.
Can a... | 37.132597 | 125 | 0.63681 |
from __future__ import division,print_function,unicode_literals
import argparse
import binascii
try:
import configparser
except ImportError:
import ConfigParser as configparser
import difflib
import json
import logging
import os
import pprint
import subprocess
import sys
def main():
config = configparser... | true | true |
f74e1b8be73d4d5e5dfa5bdf483cf85a5e40722e | 838 | py | Python | models/NER/models/lstm/token_dataset.py | GroupLe/grouple-face-tagger | 5fd87c074dc50a5fc341e9f30774094a1616a87f | [
"MIT"
] | null | null | null | models/NER/models/lstm/token_dataset.py | GroupLe/grouple-face-tagger | 5fd87c074dc50a5fc341e9f30774094a1616a87f | [
"MIT"
] | 19 | 2021-07-22T11:18:17.000Z | 2021-08-20T10:12:17.000Z | models/NER/models/lstm/token_dataset.py | GroupLe/grouple-face-tagger | 5fd87c074dc50a5fc341e9f30774094a1616a87f | [
"MIT"
] | 1 | 2021-07-29T11:56:03.000Z | 2021-07-29T11:56:03.000Z | from torch.utils.data import Dataset
import numpy as np
import torch
from . import functions
class TokensDataset(Dataset):
def __init__(self, X, Y):
self.X = self.encode_x(X)
self.y = Y
@staticmethod
def encode_x(x: list) -> list:
max_len = len(max(x, key=lambda i: len(i)))
... | 25.393939 | 67 | 0.594272 | from torch.utils.data import Dataset
import numpy as np
import torch
from . import functions
class TokensDataset(Dataset):
def __init__(self, X, Y):
self.X = self.encode_x(X)
self.y = Y
@staticmethod
def encode_x(x: list) -> list:
max_len = len(max(x, key=lambda i: len(i)))
... | true | true |
f74e1c3aa442556a3b6d4c4a8d498678c2c6ea22 | 66,024 | py | Python | zerver/tests/test_bots.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 1 | 2021-04-08T13:50:16.000Z | 2021-04-08T13:50:16.000Z | zerver/tests/test_bots.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 1 | 2019-12-24T06:51:52.000Z | 2019-12-24T06:51:52.000Z | zerver/tests/test_bots.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 1 | 2021-07-22T10:14:08.000Z | 2021-07-22T10:14:08.000Z | import filecmp
import os
from typing import Any, Dict, List, Mapping, Optional
from unittest.mock import MagicMock, patch
import orjson
from django.core import mail
from django.test import override_settings
from zulip_bots.custom_exceptions import ConfigValidationError
from zerver.lib.actions import (
do_change_s... | 39.44086 | 133 | 0.630619 | import filecmp
import os
from typing import Any, Dict, List, Mapping, Optional
from unittest.mock import MagicMock, patch
import orjson
from django.core import mail
from django.test import override_settings
from zulip_bots.custom_exceptions import ConfigValidationError
from zerver.lib.actions import (
do_change_s... | true | true |
f74e1cc7712520a33b49cf73d2107ac580f1b750 | 420 | py | Python | books/migrations/0008_book_read_online.py | TareqMonwer/reading-track | dfa1e922703a1fc6d2fa65bc3449dab54c49074a | [
"bzip2-1.0.6"
] | 1 | 2020-11-01T22:02:43.000Z | 2020-11-01T22:02:43.000Z | books/migrations/0008_book_read_online.py | TareqMonwer/reading-track | dfa1e922703a1fc6d2fa65bc3449dab54c49074a | [
"bzip2-1.0.6"
] | 7 | 2020-06-05T20:34:48.000Z | 2022-03-12T00:16:02.000Z | books/migrations/0008_book_read_online.py | TareqMonwer/reading-track | dfa1e922703a1fc6d2fa65bc3449dab54c49074a | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 3.0.2 on 2020-01-13 18:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0007_auto_20200112_1759'),
]
operations = [
migrations.AddField(
model_name='book',
name='read_online',
... | 22.105263 | 85 | 0.604762 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0007_auto_20200112_1759'),
]
operations = [
migrations.AddField(
model_name='book',
name='read_online',
field=models.URLField(blank=True, defau... | true | true |
f74e1d7d6499aa21b4260363f5e460e4b60cfde2 | 4,232 | py | Python | custom_components/microsoft/tts.py | AndrejScak/microsoft_tts | 3d901265f7b0fe70ef4e3b1fb873cf2705c8e6ee | [
"MIT"
] | null | null | null | custom_components/microsoft/tts.py | AndrejScak/microsoft_tts | 3d901265f7b0fe70ef4e3b1fb873cf2705c8e6ee | [
"MIT"
] | null | null | null | custom_components/microsoft/tts.py | AndrejScak/microsoft_tts | 3d901265f7b0fe70ef4e3b1fb873cf2705c8e6ee | [
"MIT"
] | null | null | null | """Support for the Microsoft Cognitive Services text-to-speech service."""
from http.client import HTTPException
import logging
from pycsspeechtts import pycsspeechtts
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
from homeassistant.const import CONF_API_KEY, C... | 25.648485 | 83 | 0.598062 | from http.client import HTTPException
import logging
from pycsspeechtts import pycsspeechtts
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
from homeassistant.const import CONF_API_KEY, CONF_TYPE
import homeassistant.helpers.config_validation as cv
CONF_GENDER ... | true | true |
f74e1dbac059ada44b9193a81557d3a22a5a92ba | 1,673 | py | Python | rest_api/migrations/0041_auto_20210304_1653.py | InspectorIncognito/gtfs-editor | 4e3245f44ec44aeb2d28aa25786dc95a3193fb81 | [
"MIT"
] | 2 | 2021-10-01T16:11:20.000Z | 2022-01-15T10:55:40.000Z | rest_api/migrations/0041_auto_20210304_1653.py | InspectorIncognito/gtfs-editor | 4e3245f44ec44aeb2d28aa25786dc95a3193fb81 | [
"MIT"
] | 3 | 2021-06-10T19:17:55.000Z | 2022-03-05T08:37:46.000Z | rest_api/migrations/0041_auto_20210304_1653.py | InspectorIncognito/gtfs-editor | 4e3245f44ec44aeb2d28aa25786dc95a3193fb81 | [
"MIT"
] | 1 | 2022-03-05T08:37:53.000Z | 2022-03-05T08:37:53.000Z | # Generated by Django 3.1.3 on 2021-03-04 19:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rest_api', '0040_project_loading_gtfs_job_id'),
]
operations = [
migrations.AlterField(
model_name='calendar',
name=... | 28.355932 | 57 | 0.548715 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rest_api', '0040_project_loading_gtfs_job_id'),
]
operations = [
migrations.AlterField(
model_name='calendar',
name='end_date',
field=models.DateField(d... | true | true |
f74e1de4571ee10fe7314c88cbc56ac4d0d87980 | 707 | py | Python | pc_addurl.py | manolixgt/agh_blocking_python | 6c5d3fe6c967c98e43dfbe83e3b7b0b7e9a59895 | [
"MIT"
] | null | null | null | pc_addurl.py | manolixgt/agh_blocking_python | 6c5d3fe6c967c98e43dfbe83e3b7b0b7e9a59895 | [
"MIT"
] | null | null | null | pc_addurl.py | manolixgt/agh_blocking_python | 6c5d3fe6c967c98e43dfbe83e3b7b0b7e9a59895 | [
"MIT"
] | null | null | null | from adguardhome import AdGuardHome
from keys import newpass,newuser
import asyncio
# variable de nombre y url
nuevaLista = "pc block"
urlLista = "https://raw.githubusercontent.com/manolixgt/agh_blocking_python/main/blocklists/pc_block.txt"
async def main():
async with AdGuardHome("172.16.10.199",password=... | 33.666667 | 105 | 0.738331 | from adguardhome import AdGuardHome
from keys import newpass,newuser
import asyncio
nuevaLista = "pc block"
urlLista = "https://raw.githubusercontent.com/manolixgt/agh_blocking_python/main/blocklists/pc_block.txt"
async def main():
async with AdGuardHome("172.16.10.199",password=newpass,port=80,username=ne... | true | true |
f74e1e656593dbb143fc695d6f329f916b27d1a0 | 3,687 | py | Python | v7/pyplots/pyplots.py | MattiooFR/plugins | 90a686609fb5be2e83221c1f0e8fce18cb2b6021 | [
"MIT"
] | 53 | 2015-08-14T20:28:05.000Z | 2021-06-02T00:38:23.000Z | v7/pyplots/pyplots.py | MattiooFR/plugins | 90a686609fb5be2e83221c1f0e8fce18cb2b6021 | [
"MIT"
] | 280 | 2015-01-10T15:57:44.000Z | 2022-03-27T20:47:08.000Z | v7/pyplots/pyplots.py | MattiooFR/plugins | 90a686609fb5be2e83221c1f0e8fce18cb2b6021 | [
"MIT"
] | 93 | 2015-01-26T19:39:02.000Z | 2022-03-24T17:12:42.000Z | # -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... | 34.783019 | 109 | 0.692433 |
from hashlib import md5
import io
import os
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst.directives import images
try:
import matplotlib
import matplotlib._pylab_helpers
import matplotlib.pyplot as plt
except ImportError:
matplotlib = None
from n... | true | true |
f74e201cee482688a17e393751b96207a7d4fa86 | 1,963 | py | Python | utils.py | matedealer/pem_analyser | e269b152b661cb1993cf803161a8693fbdfe649a | [
"MIT"
] | null | null | null | utils.py | matedealer/pem_analyser | e269b152b661cb1993cf803161a8693fbdfe649a | [
"MIT"
] | null | null | null | utils.py | matedealer/pem_analyser | e269b152b661cb1993cf803161a8693fbdfe649a | [
"MIT"
] | null | null | null | from datetime import datetime
CERT = "Certificate"
PUBKEY = "Public Key"
PRIVKEY = "Private Key"
# TODO: Replace dict with oid search
X509_SIG_ALGORITHMS = {
"MD2WITHRSAENCRYPTION": False,
"MD2WITHRSA": False,
"MD5WITHRSAENCRYPTION": False,
"MD5WITHRSA": False,
"SHA1WITHRSAENCRYPTION": False,
... | 28.449275 | 81 | 0.664799 | from datetime import datetime
CERT = "Certificate"
PUBKEY = "Public Key"
PRIVKEY = "Private Key"
X509_SIG_ALGORITHMS = {
"MD2WITHRSAENCRYPTION": False,
"MD2WITHRSA": False,
"MD5WITHRSAENCRYPTION": False,
"MD5WITHRSA": False,
"SHA1WITHRSAENCRYPTION": False,
"SHA1WITHRSA": False,
"SHA224WITH... | true | true |
f74e20c2dcf1c11a7d6e8bad9c8350f75612d379 | 2,137 | py | Python | posthog/request.py | mariusandra/posthog-python | 0ce011a36dce04fe09df93219152afce9c71a087 | [
"MIT"
] | null | null | null | posthog/request.py | mariusandra/posthog-python | 0ce011a36dce04fe09df93219152afce9c71a087 | [
"MIT"
] | null | null | null | posthog/request.py | mariusandra/posthog-python | 0ce011a36dce04fe09df93219152afce9c71a087 | [
"MIT"
] | null | null | null | from datetime import date, datetime
from dateutil.tz import tzutc
import logging
import json
from gzip import GzipFile
from requests.auth import HTTPBasicAuth
from requests import sessions
from io import BytesIO
from posthog.version import VERSION
from posthog.utils import remove_trailing_slash
_session = sessions.Se... | 30.098592 | 76 | 0.639682 | from datetime import date, datetime
from dateutil.tz import tzutc
import logging
import json
from gzip import GzipFile
from requests.auth import HTTPBasicAuth
from requests import sessions
from io import BytesIO
from posthog.version import VERSION
from posthog.utils import remove_trailing_slash
_session = sessions.Se... | true | true |
f74e224c0ca3d2b1f7827deaa70427aa2023367a | 8,648 | py | Python | mongoengine/dereference.py | alonho/mongoengine | 95b1783834810cd1c474851b4882a5f662887091 | [
"MIT"
] | 1 | 2020-02-15T02:07:28.000Z | 2020-02-15T02:07:28.000Z | mongoengine/dereference.py | alonho/mongoengine | 95b1783834810cd1c474851b4882a5f662887091 | [
"MIT"
] | null | null | null | mongoengine/dereference.py | alonho/mongoengine | 95b1783834810cd1c474851b4882a5f662887091 | [
"MIT"
] | null | null | null | from bson import DBRef, SON
from base import (BaseDict, BaseList, TopLevelDocumentMetaclass, get_document)
from fields import (ReferenceField, ListField, DictField, MapField)
from connection import get_db
from queryset import QuerySet
from document import Document
class DeReference(object):
def __call__(self, i... | 44.80829 | 112 | 0.554232 | from bson import DBRef, SON
from base import (BaseDict, BaseList, TopLevelDocumentMetaclass, get_document)
from fields import (ReferenceField, ListField, DictField, MapField)
from connection import get_db
from queryset import QuerySet
from document import Document
class DeReference(object):
def __call__(self, i... | true | true |
f74e227af08c65ea5bcd86aa7785adc33a7c002f | 3,190 | py | Python | bin/dnadist2anova.py | linsalrob/crAssphage | 1ea74fd7f4aec58adf1b2e8c028fa51fd621e4ea | [
"MIT"
] | 12 | 2015-11-10T11:50:38.000Z | 2020-04-07T03:55:18.000Z | bin/dnadist2anova.py | sangtaepark1973/crAssphage | 1ea74fd7f4aec58adf1b2e8c028fa51fd621e4ea | [
"MIT"
] | null | null | null | bin/dnadist2anova.py | sangtaepark1973/crAssphage | 1ea74fd7f4aec58adf1b2e8c028fa51fd621e4ea | [
"MIT"
] | 9 | 2016-01-25T21:39:18.000Z | 2021-06-01T11:16:29.000Z | """
Convert the id.map file and seqs.dnadist file to a single matrix that we can use in an anova to test
the relationship between sequences and locations
Our current keys in the metadata are:
address
altitude
country
date
latitude
longitude
name
note
source
We want to use name, cou... | 27.5 | 104 | 0.486834 |
import os
import sys
import argparse
import re
__author__ = 'Rob Edwards'
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert seqs.dnadist and seqs.')
parser.add_argument('-d', help='seqs.dnadist file (default = seqs.dnadist)', default='seqs.dnadist')
parser.add_argument('-i'... | true | true |
f74e2475994287ba3680df15cf94023b5afac86b | 13,129 | py | Python | cinder/objects/snapshot.py | aarunsai81/netapp | 8f0f7bf9be7f4d9fb9c3846bfc639c90a05f86ba | [
"Apache-2.0"
] | 11 | 2015-08-25T13:11:18.000Z | 2020-10-15T11:29:20.000Z | cinder/objects/snapshot.py | aarunsai81/netapp | 8f0f7bf9be7f4d9fb9c3846bfc639c90a05f86ba | [
"Apache-2.0"
] | 5 | 2018-01-25T11:31:56.000Z | 2019-05-06T23:13:35.000Z | cinder/objects/snapshot.py | aarunsai81/netapp | 8f0f7bf9be7f4d9fb9c3846bfc639c90a05f86ba | [
"Apache-2.0"
] | 11 | 2015-02-20T18:48:24.000Z | 2021-01-30T20:26:18.000Z | # Copyright 2015 SimpliVity Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 41.679365 | 79 | 0.628913 |
from oslo_config import cfg
from oslo_utils import versionutils
from oslo_versionedobjects import fields
from cinder import db
from cinder import exception
from cinder.i18n import _
from cinder import objects
from cinder.objects import base
from cinder.objects import fields as c_fields
CONF = cfg.CONF
@base.Cinde... | true | true |
f74e2583559d4c0907a82003793724a59a7ae12d | 6,034 | py | Python | ambari-common/src/main/python/resource_management/core/resources/system.py | mkozinenko/ambari | 9cfe9559420a1f4af89a2d645af84b1ab20d6737 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-common/src/main/python/resource_management/core/resources/system.py | mkozinenko/ambari | 9cfe9559420a1f4af89a2d645af84b1ab20d6737 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-common/src/main/python/resource_management/core/resources/system.py | mkozinenko/ambari | 9cfe9559420a1f4af89a2d645af84b1ab20d6737 | [
"Apache-2.0",
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
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");... | 31.591623 | 132 | 0.718097 |
__all__ = ["File", "Directory", "Link", "Execute", "ExecuteScript", "Mount"]
import subprocess
from resource_management.core.base import Resource, ForcedListArgument, ResourceArgument, BooleanArgument
class File(Resource):
action = ForcedListArgument(default="create")
path = ResourceArgument(default=lambda obj:... | true | true |
f74e25858576866ea46aac708eacd53f53900ca7 | 10,031 | py | Python | library/avi_gslbservice.py | kumaresanhm/Ansible-roleSDK | 4fe1d53a3738a9ac0644ff57e5f5182eb1d5a319 | [
"Apache-2.0"
] | null | null | null | library/avi_gslbservice.py | kumaresanhm/Ansible-roleSDK | 4fe1d53a3738a9ac0644ff57e5f5182eb1d5a319 | [
"Apache-2.0"
] | null | null | null | library/avi_gslbservice.py | kumaresanhm/Ansible-roleSDK | 4fe1d53a3738a9ac0644ff57e5f5182eb1d5a319 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | 41.970711 | 158 | 0.647592 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: avi_gslbservice
author: Gaurav Rastogi (grastogi@avinetworks.com)
short_description: Module for setup of GslbService Avi RESTful Object
descriptio... | true | true |
f74e25b7c762a19dd91f02d57b5315dd854cefaf | 1,479 | py | Python | intervals/endpoint.py | kitsuyui/python-intervals | 1498290cc92e81a9dc5505ade3d44e0a5264bbad | [
"BSD-3-Clause"
] | null | null | null | intervals/endpoint.py | kitsuyui/python-intervals | 1498290cc92e81a9dc5505ade3d44e0a5264bbad | [
"BSD-3-Clause"
] | null | null | null | intervals/endpoint.py | kitsuyui/python-intervals | 1498290cc92e81a9dc5505ade3d44e0a5264bbad | [
"BSD-3-Clause"
] | null | null | null | from typing import cast, Generic, TypeVar, Union
from intervals.infinity import Infinity
from intervals.comparable import Comparable
T = TypeVar('T', bound=Comparable)
class Endpoint(Generic[T]):
value: Union[T, Infinity]
open: bool
def __init__(self,
value: Union[T, Infinity],
... | 28.442308 | 48 | 0.563895 | from typing import cast, Generic, TypeVar, Union
from intervals.infinity import Infinity
from intervals.comparable import Comparable
T = TypeVar('T', bound=Comparable)
class Endpoint(Generic[T]):
value: Union[T, Infinity]
open: bool
def __init__(self,
value: Union[T, Infinity],
... | true | true |
f74e2649ade413aa1b4bd6fe59d3c397f454f3ab | 233 | py | Python | FeView/mode.py | motiurce/FeView | 8897b37062be88dd5ead2c8524f6b3b73451e25d | [
"MIT"
] | 10 | 2021-04-09T02:32:23.000Z | 2022-03-12T15:21:41.000Z | FeView/mode.py | ElsevierSoftwareX/SOFTX-D-21-00063 | 50eca2a003e6281dea3f1cf43fee221b61f53978 | [
"MIT"
] | 2 | 2021-08-07T09:02:21.000Z | 2022-02-25T09:30:22.000Z | FeView/mode.py | motiurce/FeView | 8897b37062be88dd5ead2c8524f6b3b73451e25d | [
"MIT"
] | 7 | 2021-04-09T02:32:25.000Z | 2022-03-12T15:21:45.000Z | from OpenTCLFile import *
def modeNumber(TCLFile):
global numModes
modeNumbers = OpenSeesTclRead(TCLFile, 'set numModes', 3)
if str(modeNumbers):
numModes = modeNumbers[:, 2]#.astype(int)
return numModes | 33.285714 | 62 | 0.682403 | from OpenTCLFile import *
def modeNumber(TCLFile):
global numModes
modeNumbers = OpenSeesTclRead(TCLFile, 'set numModes', 3)
if str(modeNumbers):
numModes = modeNumbers[:, 2] return numModes | true | true |
f74e26bdedbfade8bb94a73729c5e4d3273a5e7d | 10,226 | py | Python | src/metric/FIDCompoundMetric.py | sporreking/Evaluation-of-Synthetic-Face-Generation-Approaches | 480608524751c8f48445404ad92708133472cd0e | [
"MIT"
] | 1 | 2022-03-10T13:40:05.000Z | 2022-03-10T13:40:05.000Z | src/metric/FIDCompoundMetric.py | sporreking/Evaluation-of-Synthetic-Face-Generation-Approaches | 480608524751c8f48445404ad92708133472cd0e | [
"MIT"
] | 55 | 2022-03-09T13:59:11.000Z | 2022-03-31T14:58:47.000Z | src/metric/FIDCompoundMetric.py | sporreking/Evaluation-of-Synthetic-Face-Generation-Approaches | 480608524751c8f48445404ad92708133472cd0e | [
"MIT"
] | null | null | null | from src.metric.CompoundMetric import CompoundMetric
from src.metric.SampleMetricManager import SampleMetricManager
from src.core.Setupable import SetupMode
from src.metric.CompoundMetricManager import CompoundMetricManager
from typing import Any
from cleanfid import fid
from src.population.Population import Population... | 37.595588 | 109 | 0.601604 | from src.metric.CompoundMetric import CompoundMetric
from src.metric.SampleMetricManager import SampleMetricManager
from src.core.Setupable import SetupMode
from src.metric.CompoundMetricManager import CompoundMetricManager
from typing import Any
from cleanfid import fid
from src.population.Population import Population... | true | true |
f74e270598292dcff608800af38e85dee5d82cd4 | 5,405 | py | Python | st2common/tests/unit/test_action_param_utils.py | meghasfdc/st2 | 7079635e94942e7b44ae74daa6a7378a00e518d9 | [
"Apache-2.0"
] | 1 | 2020-10-26T03:26:17.000Z | 2020-10-26T03:26:17.000Z | st2common/tests/unit/test_action_param_utils.py | meghasfdc/st2 | 7079635e94942e7b44ae74daa6a7378a00e518d9 | [
"Apache-2.0"
] | 1 | 2022-03-31T03:53:22.000Z | 2022-03-31T03:53:22.000Z | st2common/tests/unit/test_action_param_utils.py | meghasfdc/st2 | 7079635e94942e7b44ae74daa6a7378a00e518d9 | [
"Apache-2.0"
] | 1 | 2019-10-11T14:42:28.000Z | 2019-10-11T14:42:28.000Z | # -*- coding: utf-8 -*-
# Copyright 2019 Extreme 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 by appli... | 39.452555 | 98 | 0.676596 |
from __future__ import absolute_import
import copy
import six
from st2common.models.utils import action_param_utils
from st2common.models.api.action import RunnerTypeAPI, ActionAPI
from st2common.persistence.action import Action
from st2common.persistence.runner import RunnerType
from st2common.bootstrap import runne... | true | true |
f74e2737062ce2668855662be96c535e6f64faf9 | 14,916 | py | Python | synapse/models/geospace.py | ackroute/synapse | 51197f89ab372d2e357bcd054358352ecca66840 | [
"Apache-2.0"
] | 216 | 2017-01-17T18:52:50.000Z | 2022-03-31T18:44:49.000Z | synapse/models/geospace.py | ackroute/synapse | 51197f89ab372d2e357bcd054358352ecca66840 | [
"Apache-2.0"
] | 2,189 | 2017-01-17T22:31:48.000Z | 2022-03-31T20:41:45.000Z | synapse/models/geospace.py | ackroute/synapse | 51197f89ab372d2e357bcd054358352ecca66840 | [
"Apache-2.0"
] | 44 | 2017-01-17T16:50:57.000Z | 2022-03-16T18:35:52.000Z | import synapse.exc as s_exc
import synapse.lib.gis as s_gis
import synapse.lib.layer as s_layer
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lib.grammar as s_grammar
units = {
'mm': 1,
'millimeter': 1,
'millimeters': 1,
'cm': 10,
'centimeter': 10,
'... | 36.558824 | 122 | 0.440735 | import synapse.exc as s_exc
import synapse.lib.gis as s_gis
import synapse.lib.layer as s_layer
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lib.grammar as s_grammar
units = {
'mm': 1,
'millimeter': 1,
'millimeters': 1,
'cm': 10,
'centimeter': 10,
'... | true | true |
f74e282ccffc9367a8e15356b6bba0d27696b612 | 39,123 | py | Python | pyFAI/goniometer.py | kif/pyFAI | 67226eb0adefbfd3fc5f7576a90a17bbc6bfb351 | [
"MIT"
] | 14 | 2015-03-25T09:36:48.000Z | 2022-03-17T12:23:27.000Z | pyFAI/goniometer.py | kif/pyFAI | 67226eb0adefbfd3fc5f7576a90a17bbc6bfb351 | [
"MIT"
] | 127 | 2015-01-02T17:17:41.000Z | 2017-06-23T13:29:11.000Z | pyFAI/goniometer.py | kif/pyFAI | 67226eb0adefbfd3fc5f7576a90a17bbc6bfb351 | [
"MIT"
] | 17 | 2015-03-25T09:36:51.000Z | 2019-10-30T12:01:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Fast Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2017-2021 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
# Permission is here... | 43.182119 | 137 | 0.613475 |
__author__ = "Jérôme Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__date__ = "19/08/2021"
__status__ = "development"
__docformat__ = 'restructuredtext'
import os
import logging
import json
import numpy
from collections... | true | true |
f74e2994b1ec6834852548db2c88289d71db090d | 757 | py | Python | src/glod/api/pps_node.py | gordon-elliott/glod | a381e21455d05d9c005942a3dee4ac67e10f366a | [
"MIT"
] | null | null | null | src/glod/api/pps_node.py | gordon-elliott/glod | a381e21455d05d9c005942a3dee4ac67e10f366a | [
"MIT"
] | 1 | 2021-03-10T16:48:34.000Z | 2021-03-10T16:48:34.000Z | src/glod/api/pps_node.py | gordon-elliott/glod | a381e21455d05d9c005942a3dee4ac67e10f366a | [
"MIT"
] | null | null | null | __copyright__ = 'Copyright(c) Gordon Elliott 2018'
"""
"""
from a_tuin.api import (
node_class,
node_connection_field,
get_update_mutation,
get_create_mutation,
get_local_fields
)
from glod.api.pps_leaf import PPSLeaf
from glod.db.pps import PPS, PPSQuery
pps_fields = get_local_fields(PPS)
PPS... | 20.459459 | 61 | 0.747688 | __copyright__ = 'Copyright(c) Gordon Elliott 2018'
from a_tuin.api import (
node_class,
node_connection_field,
get_update_mutation,
get_create_mutation,
get_local_fields
)
from glod.api.pps_leaf import PPSLeaf
from glod.db.pps import PPS, PPSQuery
pps_fields = get_local_fields(PPS)
PPSNode = no... | true | true |
f74e29992daa34dd496c75e6aa3de207a6a3ecf5 | 35,138 | py | Python | scs/x86x/features/VTMetaDataRecorder.py | kestreltechnology/kt-semantic-code-search | 3459e68b013bc0fd912072b052a1db6ef784f219 | [
"MIT"
] | 4 | 2019-09-30T10:06:34.000Z | 2021-01-04T06:38:45.000Z | scs/x86x/features/VTMetaDataRecorder.py | kestreltechnology/kt-semantic-code-search | 3459e68b013bc0fd912072b052a1db6ef784f219 | [
"MIT"
] | null | null | null | scs/x86x/features/VTMetaDataRecorder.py | kestreltechnology/kt-semantic-code-search | 3459e68b013bc0fd912072b052a1db6ef784f219 | [
"MIT"
] | 1 | 2021-09-16T02:25:30.000Z | 2021-09-16T02:25:30.000Z | # ------------------------------------------------------------------------------
# Python API to access CodeHawk Binary Analyzer analysis results
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 Kestrel Technology ... | 37.540598 | 93 | 0.607604 |
virus_stemmings = {
'ADWARE': 'Adware',
'ADW': 'Adware',
'AdPlugin': 'AdPlugin',
'Adware': 'Adware',
'AdWare': 'Adware',
'Agent': 'Agent',
'Application.Bundler': 'Application.Bundler',
'Application.Generic': 'Application.Generic',
'Application.Hacktool': 'HackTool',
'Application... | true | true |
f74e29a5869ff8ce117753c77c5563f061ecc035 | 20,386 | py | Python | converter/converter.py | CESNET/eduroam-db | c20c69e571cefe62e17c46ae61ce07f3412092d3 | [
"BSD-3-Clause"
] | 2 | 2019-08-22T11:40:19.000Z | 2020-05-06T10:33:36.000Z | converter/converter.py | CESNET/eduroam-db | c20c69e571cefe62e17c46ae61ce07f3412092d3 | [
"BSD-3-Clause"
] | 5 | 2019-05-14T06:41:01.000Z | 2021-05-07T23:53:23.000Z | converter/converter.py | CESNET/eduroam-db | c20c69e571cefe62e17c46ae61ce07f3412092d3 | [
"BSD-3-Clause"
] | 2 | 2020-05-06T12:21:57.000Z | 2020-06-05T18:32:44.000Z | #!/usr/bin/env python3
# ==============================================================================
# convert eduroam database xml v1 format to new json v2
# parameters:
# 1) directory with institution.xml files
# 2) directory where to output corresponding converted json files
# ====================================... | 37.612546 | 210 | 0.493083 |
import sys
import os
import lxml.etree
import lxml.objectify
import datetime
import config
import json
import dateutil.parser
import pytz
import click
import re
import os
from functools import singledispatch
@click.command()
@click.argument('input_dir', type=click.Path(exists=True))
@click.argument('output_dir', type... | true | true |
f74e29f8a8c1cda4dcb7380c00be03ec7e2ed858 | 3,241 | py | Python | topoflow/utils/tests/where_test.py | mintproject/topoflow | 3c19d4546129280d97eb021d1990697456c547b5 | [
"MIT"
] | 27 | 2016-01-20T11:10:39.000Z | 2021-09-29T19:31:51.000Z | topoflow/utils/tests/where_test.py | mintproject/topoflow | 3c19d4546129280d97eb021d1990697456c547b5 | [
"MIT"
] | 1 | 2016-03-30T17:28:42.000Z | 2016-03-30T17:28:42.000Z | topoflow/utils/tests/where_test.py | mintproject/topoflow | 3c19d4546129280d97eb021d1990697456c547b5 | [
"MIT"
] | 14 | 2015-03-20T04:41:43.000Z | 2021-05-31T23:09:54.000Z |
#------------------------------------------------------
# S.D. Peckham
# March 25, 2009
# Speed tests for different uses of NumPy's "where"
#------------------------------------------------------
import time
import numpy
from numpy import *
def Speed_Test(n):
a = reshape(arange(n*n, dtype='Float64'), (n,n))
... | 27.939655 | 72 | 0.445233 |
#------------------------------------------------------
import time
import numpy
from numpy import *
def Speed_Test(n):
a = reshape(arange(n*n, dtype='Float64'), (n,n))
nw = 0
# SET_ZERO = False
SET_ZERO = True
#--------------------------
# Standard where use test
#-----------------... | false | true |
f74e2a6887f06d7a47f504efd9514a2b0716bc0a | 7,501 | py | Python | routines/es/_routines/_vtst.py | cmulvihill/mechdriver | 296cc3b4c154889c11470c7b82315b0382334b98 | [
"Apache-2.0"
] | null | null | null | routines/es/_routines/_vtst.py | cmulvihill/mechdriver | 296cc3b4c154889c11470c7b82315b0382334b98 | [
"Apache-2.0"
] | null | null | null | routines/es/_routines/_vtst.py | cmulvihill/mechdriver | 296cc3b4c154889c11470c7b82315b0382334b98 | [
"Apache-2.0"
] | null | null | null | """ Run and Read the scans from VTST calculations
"""
import automol
import autofile
from routines.es._routines import sp
from routines.es._routines import _wfn as wfn
from routines.es._routines import _scan as scan
from lib import filesys
from lib.submission import qchem_params
from lib.reaction import grid as rxngri... | 35.889952 | 79 | 0.626183 |
import automol
import autofile
from routines.es._routines import sp
from routines.es._routines import _wfn as wfn
from routines.es._routines import _scan as scan
from lib import filesys
from lib.submission import qchem_params
from lib.reaction import grid as rxngrid
def radrad_scan(ts_zma, ts_info, hs_info,
... | true | true |
f74e2b481266739896310173961edc9fd3a92e49 | 1,462 | py | Python | app/lib/base/password_complexity.py | ctxis/crackerjack | f354cda0e1c6688527018361f24abf2114a77939 | [
"MIT"
] | 237 | 2020-03-26T12:39:24.000Z | 2022-03-28T04:46:22.000Z | app/lib/base/password_complexity.py | FDlucifer/crackerjack | f828aeb7bef6788a179b2c617f9121e317a0eea1 | [
"MIT"
] | 18 | 2020-03-31T14:59:00.000Z | 2022-03-19T08:37:07.000Z | app/lib/base/password_complexity.py | FDlucifer/crackerjack | f828aeb7bef6788a179b2c617f9121e317a0eea1 | [
"MIT"
] | 61 | 2020-03-29T13:53:54.000Z | 2022-03-22T12:36:14.000Z | class PasswordComplexityManager:
def __init__(self, min_length, min_lower, min_upper, min_digits, min_special):
self.min_length = int(min_length)
self.min_lower = int(min_lower)
self.min_upper = int(min_upper)
self.min_digits = int(min_digits)
self.min_special = int(min... | 33.227273 | 83 | 0.551984 | class PasswordComplexityManager:
def __init__(self, min_length, min_lower, min_upper, min_digits, min_special):
self.min_length = int(min_length)
self.min_lower = int(min_lower)
self.min_upper = int(min_upper)
self.min_digits = int(min_digits)
self.min_special = int(min... | true | true |
f74e2bb348159c1f51feda915a4b9ce7e35a63cb | 24,544 | py | Python | tccli/services/solar/solar_client.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | null | null | null | tccli/services/solar/solar_client.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | null | null | null | tccli/services/solar/solar_client.py | zqfan/tencentcloud-cli | b6ad9fced2a2b340087e4e5522121d405f68b615 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError
from tencentcloud.common import credential
from tencentcloud.common.profile.ht... | 42.099485 | 105 | 0.722009 | import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError
from tencentcloud.common import credential
from tencentcloud.common.profile.http_profile import HttpPr... | true | true |
f74e2c055fb4c6aec978eec83a92c73e86632317 | 675 | py | Python | src/core/toga/widgets/image.py | Donyme/toga | 2647c7dc5db248025847e3a60b115ff51d4a0d4a | [
"BSD-3-Clause"
] | null | null | null | src/core/toga/widgets/image.py | Donyme/toga | 2647c7dc5db248025847e3a60b115ff51d4a0d4a | [
"BSD-3-Clause"
] | null | null | null | src/core/toga/widgets/image.py | Donyme/toga | 2647c7dc5db248025847e3a60b115ff51d4a0d4a | [
"BSD-3-Clause"
] | null | null | null | from toga.platform import get_platform_factory
class Image(object):
"""
Args:
path (str): Path to the image.
factory (:obj:`module`): A python module that is capable to return a
implementation of this class with the same name. (optional & normally not needed)
"""
def __ini... | 27 | 93 | 0.637037 | from toga.platform import get_platform_factory
class Image(object):
def __init__(self, path, factory=None):
self.factory = factory if factory else get_platform_factory()
self._impl = self.factory.Image(interface=self)
self.path = path
@property
def path(self):
return self.... | true | true |
f74e2c30a54a58011da62691c2eb6209ea130c5f | 32,652 | py | Python | chatterbot/languages.py | nadimpayak/ChatBot | cce2377cb445000a5b2e3bc39b955276ae217740 | [
"BSD-3-Clause"
] | 6 | 2020-03-24T01:27:06.000Z | 2021-05-12T02:24:55.000Z | venv/lib/python3.6/site-packages/chatterbot/languages.py | assaufianggie/VerraBot | cbe46ccb219c2972871e760268b427e1f8e79f93 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/chatterbot/languages.py | assaufianggie/VerraBot | cbe46ccb219c2972871e760268b427e1f8e79f93 | [
"MIT"
] | 2 | 2020-05-25T07:24:31.000Z | 2021-09-17T09:14:25.000Z | class AAR:
ISO_639_1 = ''
ISO_639 = 'aar'
ENGLISH_NAME = 'Afar'
class ABK:
ISO_639_1 = ''
ISO_639 = 'abk'
ENGLISH_NAME = 'Abkhazian'
class ACE:
ISO_639_1 = ''
ISO_639 = 'ace'
ENGLISH_NAME = 'Achinese'
class ACH:
ISO_639_1 = ''
ISO_639 = 'ach'
ENGLISH_NAME = 'Acoli'
... | 13.542928 | 46 | 0.569153 | class AAR:
ISO_639_1 = ''
ISO_639 = 'aar'
ENGLISH_NAME = 'Afar'
class ABK:
ISO_639_1 = ''
ISO_639 = 'abk'
ENGLISH_NAME = 'Abkhazian'
class ACE:
ISO_639_1 = ''
ISO_639 = 'ace'
ENGLISH_NAME = 'Achinese'
class ACH:
ISO_639_1 = ''
ISO_639 = 'ach'
ENGLISH_NAME = 'Acoli'
... | true | true |
f74e2c7d77b86c47c3dfc5969859cb1017662173 | 1,021 | py | Python | data/contacts.py | ngalkina86/python_training-1 | 4908bcf553eca840bd7fa09711cd8f20d8ad4ea1 | [
"Apache-2.0"
] | null | null | null | data/contacts.py | ngalkina86/python_training-1 | 4908bcf553eca840bd7fa09711cd8f20d8ad4ea1 | [
"Apache-2.0"
] | null | null | null | data/contacts.py | ngalkina86/python_training-1 | 4908bcf553eca840bd7fa09711cd8f20d8ad4ea1 | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
testdata = [
Contact(firstname ="firstname", middlename ="middlename", lastname ="lastname", nickname ="nickname", title ="title",
company ="company",address ="address", home ="home", mobile ="mobile", work ="work",fax ="fax",
email = "email... | 85.083333 | 125 | 0.589618 | from model.contact import Contact
testdata = [
Contact(firstname ="firstname", middlename ="middlename", lastname ="lastname", nickname ="nickname", title ="title",
company ="company",address ="address", home ="home", mobile ="mobile", work ="work",fax ="fax",
email = "email... | true | true |
f74e2c8ed7556985e1ea42c54321609f976f36d5 | 7,345 | py | Python | pipeline/improv.py | Dakad/HackSabamApp | 03fb248f6c067febdc5d131d9cdc8fa82c80c40d | [
"MIT"
] | null | null | null | pipeline/improv.py | Dakad/HackSabamApp | 03fb248f6c067febdc5d131d9cdc8fa82c80c40d | [
"MIT"
] | null | null | null | pipeline/improv.py | Dakad/HackSabamApp | 03fb248f6c067febdc5d131d9cdc8fa82c80c40d | [
"MIT"
] | null | null | null | from skimage.filters import threshold_local
import numpy as np
import cv2
import imutils
# https://github.com/yardstick17/image_text_reader/blob/master/image_preprocessing/remove_noise.py
def _order_points_(pts):
# initialzie a list of coordinates that will be ordered
# such that the first entry in the list ... | 33.692661 | 101 | 0.643567 | from skimage.filters import threshold_local
import numpy as np
import cv2
import imutils
def _order_points_(pts):
rect = np.zeros((4, 2), dtype="float32")
s = pts.sum(axis=1)
rect[0] = pts[np.argmin(s)]
rect[2] = pts[np.argmax(s)]
diff = np.diff(pts, axis=1)
... | true | true |
f74e2d01bfb7fd5d65dc4a0ec37c2506d6b427ff | 20,587 | py | Python | datasette/facets.py | sipereira/datasette | b78522423e99a96922c9ad33289c83eeccb931ca | [
"Apache-2.0"
] | 5,978 | 2017-11-13T21:59:52.000Z | 2022-03-31T12:10:42.000Z | datasette/facets.py | sipereira/datasette | b78522423e99a96922c9ad33289c83eeccb931ca | [
"Apache-2.0"
] | 1,482 | 2017-11-13T21:19:43.000Z | 2022-03-31T07:45:26.000Z | datasette/facets.py | sipereira/datasette | b78522423e99a96922c9ad33289c83eeccb931ca | [
"Apache-2.0"
] | 439 | 2017-11-13T22:03:30.000Z | 2022-03-30T08:00:39.000Z | import json
import urllib
from datasette import hookimpl
from datasette.database import QueryInterrupted
from datasette.utils import (
escape_sqlite,
path_with_added_args,
path_with_removed_args,
detect_json1,
sqlite3,
)
def load_facet_configs(request, table_metadata):
# Given a request and th... | 39.590385 | 88 | 0.471511 | import json
import urllib
from datasette import hookimpl
from datasette.database import QueryInterrupted
from datasette.utils import (
escape_sqlite,
path_with_added_args,
path_with_removed_args,
detect_json1,
sqlite3,
)
def load_facet_configs(request, table_metadata):
... | true | true |
f74e2d813c7cf708beddaf6fe05950c536798b94 | 587 | py | Python | web-frameworks/django/celeryWithDjango/publish/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | web-frameworks/django/celeryWithDjango/publish/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | web-frameworks/django/celeryWithDjango/publish/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
from django.contrib.auth import get_user_model
# Create your models here.
class Post(models.Model):
author = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
created = models.DateTimeField('Created Date', default=timezone.now)
ti... | 34.529412 | 74 | 0.72402 | from django.db import models
from django.utils import timezone
from django.contrib.auth import get_user_model
class Post(models.Model):
author = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
created = models.DateTimeField('Created Date', default=timezone.now)
title = models.CharField('Tit... | true | true |
f74e2e305445c9d4ce3df2117c655cf8608d6ac4 | 2,261 | py | Python | CLASSIC PUZZLE - MEDIUM/222-rubiks-cube-movements.py | martincourtois/CodinGame | 4df9c8af5cb9c513880dd086da9bf3f201bd56ed | [
"Unlicense"
] | null | null | null | CLASSIC PUZZLE - MEDIUM/222-rubiks-cube-movements.py | martincourtois/CodinGame | 4df9c8af5cb9c513880dd086da9bf3f201bd56ed | [
"Unlicense"
] | null | null | null | CLASSIC PUZZLE - MEDIUM/222-rubiks-cube-movements.py | martincourtois/CodinGame | 4df9c8af5cb9c513880dd086da9bf3f201bd56ed | [
"Unlicense"
] | null | null | null | import sys
import math
import re
import numpy as np
FRONT = [
( (2, 2), (2, 3), (3, 3), (3, 2), (2, 2) ),
( (1, 2), (2, 4), (4, 3), (3, 1), (1, 2) ),
( (1, 3), (3, 4), (4, 2), (2, 1), (1, 3) )
]
BACK = [
( (2, 6), (2, 7), (3, 7), (3, 6), (2, 6) ),
( (2, 5), (0, 2), (3, 0), (5, 3), (2, 5) ),
( (0, 3),... | 25.693182 | 65 | 0.418841 | import sys
import math
import re
import numpy as np
FRONT = [
( (2, 2), (2, 3), (3, 3), (3, 2), (2, 2) ),
( (1, 2), (2, 4), (4, 3), (3, 1), (1, 2) ),
( (1, 3), (3, 4), (4, 2), (2, 1), (1, 3) )
]
BACK = [
( (2, 6), (2, 7), (3, 7), (3, 6), (2, 6) ),
( (2, 5), (0, 2), (3, 0), (5, 3), (2, 5) ),
( (0, 3),... | true | true |
f74e2f5c2661ae0b7a0d6833059f2bec833d500a | 1,494 | py | Python | workflow/scripts/builder/gtf2protein_coding_genes.py | mtandon09/RNA-seek | 1e812f7411f0047ed6e848584c64041da5f77fef | [
"MIT"
] | 1 | 2022-03-19T14:22:22.000Z | 2022-03-19T14:22:22.000Z | workflow/scripts/builder/gtf2protein_coding_genes.py | OpenOmics/RNA-seek | f953ae412a89a722a2d7b97827f08d6cc9570776 | [
"MIT"
] | null | null | null | workflow/scripts/builder/gtf2protein_coding_genes.py | OpenOmics/RNA-seek | f953ae412a89a722a2d7b97827f08d6cc9570776 | [
"MIT"
] | null | null | null | from __future__ import print_function
import sys
# USAGE
# sys.argv[1] = genes.gtf
# Example
# $ python gtf2protein_coding_genes.py genes.gtf > protein_coding_genes.lst
def get_value(mykey, lookup):
try:
myvalue = lookup[mykey]
except KeyError:
myvalue = ''
return myvalue.strip('"').strip("'")
def seperate... | 23.34375 | 84 | 0.688086 | from __future__ import print_function
import sys
def get_value(mykey, lookup):
try:
myvalue = lookup[mykey]
except KeyError:
myvalue = ''
return myvalue.strip('"').strip("'")
def seperated(pairslist):
for kv in pairslist:
k = kv.split(' ')[0]
v = " ".join(kv.split(' ')[1:]).rstrip(';')
yield k,v
d... | true | true |
f74e2f879d980ae44ebdc8842cdc68d5dbdf36f3 | 75 | py | Python | data/studio21_generated/interview/0456/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/0456/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | data/studio21_generated/interview/0456/starter_code.py | vijaykumawat256/Prompt-Summarization | 614f5911e2acd2933440d909de2b4f86653dc214 | [
"Apache-2.0"
] | null | null | null | class Solution:
def canCross(self, stones: List[int]) -> bool:
| 25 | 50 | 0.6 | class Solution:
def canCross(self, stones: List[int]) -> bool:
| false | true |
f74e306a726609571740d815d8d3bd83ea31e94d | 1,127 | py | Python | setup.py | the-moog/trac-includemacro | 03216971736b366917711a955b16e2a034c93fed | [
"BSD-3-Clause"
] | null | null | null | setup.py | the-moog/trac-includemacro | 03216971736b366917711a955b16e2a034c93fed | [
"BSD-3-Clause"
] | null | null | null | setup.py | the-moog/trac-includemacro | 03216971736b366917711a955b16e2a034c93fed | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2008 Noah Kantrowitz <noah@coderanger.net>
# Copyright (C) 2012 Ryan J Ollos <ryan.j.ollos@gmail.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.... | 28.897436 | 95 | 0.670807 |
import os.path
from setuptools import setup
setup(
name='TracIncludeMacro',
version='4.0.0',
packages=['includemacro'],
author='Noah Kantrowitz',
author_email='noah@coderanger.net',
maintainer='Ryan J Ollos',
maintainer_email='ryan.j.ollos@gmail.com',
description='Include the contents... | true | true |
f74e31c8153afe5250c8deec735a6fa37bb5394e | 5,681 | py | Python | tests/cli/config/test_set.py | ashemedai/hatch | 9ec00d5e027c992efbc16dd777b1f6926368b6bf | [
"MIT"
] | null | null | null | tests/cli/config/test_set.py | ashemedai/hatch | 9ec00d5e027c992efbc16dd777b1f6926368b6bf | [
"MIT"
] | null | null | null | tests/cli/config/test_set.py | ashemedai/hatch | 9ec00d5e027c992efbc16dd777b1f6926368b6bf | [
"MIT"
] | null | null | null | def test_standard(hatch, config_file, helpers):
result = hatch('config', 'set', 'project', 'foo')
assert result.exit_code == 0, result.output
assert result.output == helpers.dedent(
"""
New setting:
project = "foo"
"""
)
config_file.load()
assert config_file.mod... | 25.59009 | 91 | 0.591269 | def test_standard(hatch, config_file, helpers):
result = hatch('config', 'set', 'project', 'foo')
assert result.exit_code == 0, result.output
assert result.output == helpers.dedent(
"""
New setting:
project = "foo"
"""
)
config_file.load()
assert config_file.mod... | true | true |
f74e3222c8e946c690d9d66b3030c979cfd0b397 | 3,090 | py | Python | Python3Lab/project/v3/main.py | YeoGiyong/HelloPython3 | 81e56b6748da8f8dd818af943f5d98ef384f109e | [
"Apache-2.0"
] | null | null | null | Python3Lab/project/v3/main.py | YeoGiyong/HelloPython3 | 81e56b6748da8f8dd818af943f5d98ef384f109e | [
"Apache-2.0"
] | null | null | null | Python3Lab/project/v3/main.py | YeoGiyong/HelloPython3 | 81e56b6748da8f8dd818af943f5d98ef384f109e | [
"Apache-2.0"
] | null | null | null | import sys
from . import sjvo, sjsrv
class SungJukV3Main:
#성적 처리 서비스 객체 생성
sjsrv = sjsrv.SungJukService()
#메뉴표시
def displayMenu(self):
str_list = []
str_list.append(' -= 성적 처리 프로그램 v3 =-\n')
str_list.append('----------------------------\n')
str_list.append(' 1: 새로운 성적데... | 29.150943 | 62 | 0.526214 | import sys
from . import sjvo, sjsrv
class SungJukV3Main:
sjsrv = sjsrv.SungJukService()
def displayMenu(self):
str_list = []
str_list.append(' -= 성적 처리 프로그램 v3 =-\n')
str_list.append('----------------------------\n')
str_list.append(' 1: 새로운 성적데이터 추가 \n')
str_... | true | true |
f74e32c30eec178b928efc81471d1a8efb822ff3 | 2,772 | py | Python | surveysite/survey/views.py | cicorias/njit-is601-project | f383d52525a8d3358038cbccd8039bac0b64d723 | [
"Apache-2.0"
] | null | null | null | surveysite/survey/views.py | cicorias/njit-is601-project | f383d52525a8d3358038cbccd8039bac0b64d723 | [
"Apache-2.0"
] | 3 | 2020-07-26T15:26:24.000Z | 2021-09-22T19:31:13.000Z | surveysite/survey/views.py | cicorias/njit-is601-project | f383d52525a8d3358038cbccd8039bac0b64d723 | [
"Apache-2.0"
] | null | null | null | from typing import Tuple, Any, Dict
import uuid
from django.http import (HttpResponse,
HttpRequest,
Http404,
HttpResponseRedirect,
JsonResponse)
from django.views.generic import ListView, View, TemplateView
from django.... | 31.5 | 85 | 0.619408 | from typing import Tuple, Any, Dict
import uuid
from django.http import (HttpResponse,
HttpRequest,
Http404,
HttpResponseRedirect,
JsonResponse)
from django.views.generic import ListView, View, TemplateView
from django.... | true | true |
f74e340bb863ab04b403c5cdda9ca57c592b0438 | 210 | py | Python | notification/urls.py | lmorchard/django-notification | 728df05ce6e8921862a42bb647adae27a6fa9e22 | [
"MIT"
] | null | null | null | notification/urls.py | lmorchard/django-notification | 728df05ce6e8921862a42bb647adae27a6fa9e22 | [
"MIT"
] | null | null | null | notification/urls.py | lmorchard/django-notification | 728df05ce6e8921862a42bb647adae27a6fa9e22 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import patterns, url
from notification.views import notice_settings
urlpatterns = patterns("",
url(r"^settings/$", notice_settings, name="notification_notice_settings"),
)
| 23.333333 | 78 | 0.77619 | from django.conf.urls.defaults import patterns, url
from notification.views import notice_settings
urlpatterns = patterns("",
url(r"^settings/$", notice_settings, name="notification_notice_settings"),
)
| true | true |
f74e352d863c1abc31b03d3439db50415ba85d61 | 5,867 | py | Python | src/plot.py | ConorDevilly/bar_speed | 7a48a21b7dc9794b99a0f65c59a12f7f65d385e6 | [
"MIT"
] | null | null | null | src/plot.py | ConorDevilly/bar_speed | 7a48a21b7dc9794b99a0f65c59a12f7f65d385e6 | [
"MIT"
] | null | null | null | src/plot.py | ConorDevilly/bar_speed | 7a48a21b7dc9794b99a0f65c59a12f7f65d385e6 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import argparse
import numpy as np
class BarGraph():
"""
Loads data from a log file
Has ability to display three graphs: Speed, Acceleration and Power
"""
def load_data(self, path_to_data):
"""Parse necessary data from a file"""
with open(path_to_da... | 35.77439 | 113 | 0.638827 | import matplotlib.pyplot as plt
import argparse
import numpy as np
class BarGraph():
def load_data(self, path_to_data):
with open(path_to_data, 'r') as log:
lines = log.readlines()
self.distance_data = self._load_distance_data(lines)
self.cm_multiplier = self._load_cm_... | true | true |
f74e3574d2fe5c321480db90441cbe998019b4ee | 1,797 | py | Python | dataset-snippets/summarize_a_survey_by_question_concept_id.py | rfrancis1/workbench-snippets | 0c49b55b65d808cbf94b429e340cedaf62b2eeda | [
"BSD-3-Clause"
] | 3 | 2019-05-14T21:10:35.000Z | 2021-02-25T04:53:41.000Z | dataset-snippets/summarize_a_survey_by_question_concept_id.py | rfrancis1/workbench-snippets | 0c49b55b65d808cbf94b429e340cedaf62b2eeda | [
"BSD-3-Clause"
] | 42 | 2019-05-13T20:27:45.000Z | 2022-01-05T19:42:19.000Z | dataset-snippets/summarize_a_survey_by_question_concept_id.py | rfrancis1/workbench-snippets | 0c49b55b65d808cbf94b429e340cedaf62b2eeda | [
"BSD-3-Clause"
] | 4 | 2019-05-13T13:23:58.000Z | 2021-06-23T16:21:37.000Z | # Use snippet 'summarize_a_survey_module' to output a table and a graph of
# participant counts by response for one question_concept_id
# The snippet assumes that a dataframe containing survey questions and answers already exists
# The snippet also assumes that setup has been run
# Update the next 3 lines
survey_df =... | 46.076923 | 128 | 0.613244 |
survey_df = YOUR_DATASET_NAME_survey_df
question_concept_id = 1585940
denominator = None
####################################################################################
def summarize_a_question_concept_id(df, question_concept_id, denominator=None):
df = df.loc[df['question_concept_id'] == question_concept_id... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.