max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
backend/abcd.py | rohitner/SCT2018 | 1 | 6622351 | <gh_stars>1-10
import matplotlib as mpl;
import matplotlib.pyplot as plt;
import numpy as np;
from pandas import read_csv;
import gzip;
import StringIO;
import sys;
def parse_header_of_csv(csv_str):
# Isolate the headline columns:
headline = csv_str[:csv_str.index('\n')];
columns = headline.split(',');
# The firs... | import matplotlib as mpl;
import matplotlib.pyplot as plt;
import numpy as np;
from pandas import read_csv;
import gzip;
import StringIO;
import sys;
def parse_header_of_csv(csv_str):
# Isolate the headline columns:
headline = csv_str[:csv_str.index('\n')];
columns = headline.split(',');
# The first column should... | en | 0.770948 | # Isolate the headline columns: # The first column should be timestamp: # The last column should be label_source: # Search for the column of the first label: # Feature columns come after timestamp and before the labels: # Then come the labels, till the one-before-last column: # In the CSV the label names appear with pr... | 3.136169 | 3 |
label_studio/tests/data_manager_test.py | mengzaiqiao/label-studio | 2 | 6622352 | import pytest
# label_studio
from label_studio import blueprint as server
from label_studio.tests.base import goc_project
@pytest.fixture(autouse=True)
def default_project(monkeypatch):
"""
apply patch for
label_studio.server.project_get_or_create()
for all tests.
"""
monkeypatch.... | import pytest
# label_studio
from label_studio import blueprint as server
from label_studio.tests.base import goc_project
@pytest.fixture(autouse=True)
def default_project(monkeypatch):
"""
apply patch for
label_studio.server.project_get_or_create()
for all tests.
"""
monkeypatch.... | en | 0.739474 | # label_studio apply patch for label_studio.server.project_get_or_create() for all tests. Table Columns Table Tabs # post # get # patch # delete # check TAB has selectedItems # select all # delete all # post # get # patch # delete # GET: check action list Remove tasks by ids # POST: delete 3 tasks Remov... | 2.053941 | 2 |
sei_py/base/exception.py | xh4zr/sei_py | 1 | 6622353 | <gh_stars>1-10
class SeiException(Exception):
def __init__(self, message, errors):
super(SeiException, self).__init__(message)
self.errors = errors
| class SeiException(Exception):
def __init__(self, message, errors):
super(SeiException, self).__init__(message)
self.errors = errors | none | 1 | 2.314523 | 2 | |
game_pkg/stories.py | DejunJackson/Madlibs | 0 | 6622354 | <gh_stars>0
"""This Module holds all the possible stories and queries to collect those stories"""
import random
def story_one(words):
if words == {}:
body_part = input("Name a body part. \n")
adjective = input("Name an adjective. \n")
place = input("Name a city. \n")
adjective2 = i... | """This Module holds all the possible stories and queries to collect those stories"""
import random
def story_one(words):
if words == {}:
body_part = input("Name a body part. \n")
adjective = input("Name an adjective. \n")
place = input("Name a city. \n")
adjective2 = input("Name a... | en | 0.901965 | This Module holds all the possible stories and queries to collect those stories # Selects random stories to play for each game | 3.738256 | 4 |
mainpg/models.py | mohitdmak/Community-Page | 3 | 6622355 | from django.db import models
from django.contrib.auth.models import User
from django.db.models.fields.related import ForeignKey
from django.utils import timezone
from django.urls import reverse
from PIL import Image
from allauth.socialaccount.models import SocialAccount
class Question(models.Model):
subject = mode... | from django.db import models
from django.contrib.auth.models import User
from django.db.models.fields.related import ForeignKey
from django.utils import timezone
from django.urls import reverse
from PIL import Image
from allauth.socialaccount.models import SocialAccount
class Question(models.Model):
subject = mode... | none | 1 | 2.16069 | 2 | |
tests/utils/test_pluggable_interface.py | Purg/SMQTK | 1 | 6622356 | import os
import pytest
# noinspection PyUnresolvedReferences
from six.moves import mock
from smqtk.utils.plugin import Pluggable, NotUsableError
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
class DummyImpl (Pluggable):
TEST_USABLE = True
@classmethod
def is_usable(cls):
return cls.... | import os
import pytest
# noinspection PyUnresolvedReferences
from six.moves import mock
from smqtk.utils.plugin import Pluggable, NotUsableError
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
class DummyImpl (Pluggable):
TEST_USABLE = True
@classmethod
def is_usable(cls):
return cls.... | en | 0.762151 | # noinspection PyUnresolvedReferences ############################################################################### # Tests # Construction should happen without incident # Should raise NotUsableError exception on construction. Test that the correct package and containing module directory is correct for the dummy ... | 1.995495 | 2 |
tenant_faq/urls.py | smegurus/smegurus-django | 1 | 6622357 | <reponame>smegurus/smegurus-django
from django.conf.urls import include, url
from tenant_faq import views
urlpatterns = (
url(r'^faq$', views.faq_page, name='tenant_faq'),
)
| from django.conf.urls import include, url
from tenant_faq import views
urlpatterns = (
url(r'^faq$', views.faq_page, name='tenant_faq'),
) | none | 1 | 1.620103 | 2 | |
api/nhlapi/graphql/definitions/player.py | rosszm/hashmarks | 0 | 6622358 | import strawberry
from enum import Enum
from nhlapi.graphql.definitions.team import Team
from nhlapi.clients.stats import StatsClient
@strawberry.type
class Location:
"""
Represents a city location.
"""
city: str
state_province: str
country: str
@strawberry.enum
class Handedness(Enum):
R... | import strawberry
from enum import Enum
from nhlapi.graphql.definitions.team import Team
from nhlapi.clients.stats import StatsClient
@strawberry.type
class Location:
"""
Represents a city location.
"""
city: str
state_province: str
country: str
@strawberry.enum
class Handedness(Enum):
R... | en | 0.915042 | Represents a city location. Represents a position in the game of hockey. Represents an NHL Player. The full name of the player. The current team of the player. Creates a new player from a dictionary representation. Args: dict: the dictionary representation of the player. The dict keys are expected ... | 3.007812 | 3 |
aiida/orm/calculation/job/quantumespresso/pw.py | BIGDATA2015-AIIDA-EXTENSION/query_engine | 0 | 6622359 | # -*- coding: utf-8 -*-
"""
Plugin to create a Quantum Espresso pw.x file.
"""
# TODO: COPY OUTDIR FROM PREVIOUS CALCULATION! Should be an input node of type
# RemoteData (or maybe subclass it?).
# TODO: tests!
# TODO: DOC + implementation of SETTINGS
# TODO: preexec, postexec
# TODO: Check that no further paramet... | # -*- coding: utf-8 -*-
"""
Plugin to create a Quantum Espresso pw.x file.
"""
# TODO: COPY OUTDIR FROM PREVIOUS CALCULATION! Should be an input node of type
# RemoteData (or maybe subclass it?).
# TODO: tests!
# TODO: DOC + implementation of SETTINGS
# TODO: preexec, postexec
# TODO: Check that no further paramet... | en | 0.739929 | # -*- coding: utf-8 -*- Plugin to create a Quantum Espresso pw.x file. # TODO: COPY OUTDIR FROM PREVIOUS CALCULATION! Should be an input node of type # RemoteData (or maybe subclass it?). # TODO: tests! # TODO: DOC + implementation of SETTINGS # TODO: preexec, postexec # TODO: Check that no further parameters are ... | 1.87324 | 2 |
contrib/scripts/test_false_positives.py | electrumsv/libcuckoofilter | 0 | 6622360 | <filename>contrib/scripts/test_false_positives.py
"""
.... false positives ....
maximum entries, added entries, minimum, maximum, average
16000, 2000, 231, 301, 262.8
16000, 4000, 470, 601, 535.4
16000, 8000, ... | <filename>contrib/scripts/test_false_positives.py
"""
.... false positives ....
maximum entries, added entries, minimum, maximum, average
16000, 2000, 231, 301, 262.8
16000, 4000, 470, 601, 535.4
16000, 8000, ... | en | 0.357069 | .... false positives .... maximum entries, added entries, minimum, maximum, average 16000, 2000, 231, 301, 262.8 16000, 4000, 470, 601, 535.4 16000, 8000, 1005, 1161, 1075.9 16000, 16000, 2021, 2270, 2139.1 ... | 1.60849 | 2 |
postprocessing/plot_aggregate_data.py | mvousden/psap | 0 | 6622361 | <gh_stars>0
#!/usr/bin/env python3
# Postprocessing for data aggregated from many individual annealing
# procedures. The input CSV file should have these headings:
#
# - Problem Size: String
# - Synchronisation: String
# - Number of Compute Workers: Degree of parallelism (int64).
# - Runtime: Execution time in uni... | #!/usr/bin/env python3
# Postprocessing for data aggregated from many individual annealing
# procedures. The input CSV file should have these headings:
#
# - Problem Size: String
# - Synchronisation: String
# - Number of Compute Workers: Degree of parallelism (int64).
# - Runtime: Execution time in units of your c... | en | 0.786793 | #!/usr/bin/env python3 # Postprocessing for data aggregated from many individual annealing # procedures. The input CSV file should have these headings: # # - Problem Size: String # - Synchronisation: String # - Number of Compute Workers: Degree of parallelism (int64). # - Runtime: Execution time in units of your ch... | 3.068261 | 3 |
topi/python/topi/cuda/rcnn/__init__.py | mingwayzhang/tvm | 48 | 6622362 | <reponame>mingwayzhang/tvm
# pylint: disable=wildcard-import
"""Faster R-CNN and Mask R-CNN operators"""
from .proposal import *
| # pylint: disable=wildcard-import
"""Faster R-CNN and Mask R-CNN operators"""
from .proposal import * | en | 0.709287 | # pylint: disable=wildcard-import Faster R-CNN and Mask R-CNN operators | 1.09825 | 1 |
examples/logo.py | luzpaz/cqparts | 69 | 6622363 | <filename>examples/logo.py
"""
This example makes the cqparts logo
"""
from cqparts import Assembly
class CQPartsLogo(Assembly):
# TODO
pass
| <filename>examples/logo.py
"""
This example makes the cqparts logo
"""
from cqparts import Assembly
class CQPartsLogo(Assembly):
# TODO
pass
| en | 0.727675 | This example makes the cqparts logo # TODO | 1.271478 | 1 |
Python/Bit--Manipulation/toggle_kth_bit.py | Khushboo85277/NeoAlgo | 897 | 6622364 | <filename>Python/Bit--Manipulation/toggle_kth_bit.py
# Python program to toggle the k-th bit of a number.
def toggle(num, k):
return (num ^ (1 << (k-1)))
if __name__ == '__main__':
print("Enter the number: ", end="")
n = int(input())
print("Enter the value of k(where you need to toggle the k'th bit): ... | <filename>Python/Bit--Manipulation/toggle_kth_bit.py
# Python program to toggle the k-th bit of a number.
def toggle(num, k):
return (num ^ (1 << (k-1)))
if __name__ == '__main__':
print("Enter the number: ", end="")
n = int(input())
print("Enter the value of k(where you need to toggle the k'th bit): ... | en | 0.711806 | # Python program to toggle the k-th bit of a number. Time Complexity: O(1) Space Complexity: O(1) SAMPLE INPUT AND OUTPUT SAMPLE 1 Enter the number: 24 Enter the value of k(where you need to toggle the k'th bit): 3 The given number, after toggling the k-th bit is 28. SAMPLE 2 Enter the number: 33 Enter the value of ... | 4.441402 | 4 |
fastlab/routers/__init__.py | tezignlab/fastweb | 14 | 6622365 | from .health import HealthRouter
__all__ = ['HealthRouter']
| from .health import HealthRouter
__all__ = ['HealthRouter']
| none | 1 | 1.124519 | 1 | |
RAFT/raft/omdao_raft.py | ptrbortolotti/WEIS | 26 | 6622366 | import openmdao.api as om
import raft
import numpy as np
ndim = 3
ndof = 6
class RAFT_OMDAO(om.ExplicitComponent):
"""
RAFT OpenMDAO Wrapper API
"""
def initialize(self):
self.options.declare('modeling_options')
self.options.declare('turbine_options')
self.options.declare('moor... | import openmdao.api as om
import raft
import numpy as np
ndim = 3
ndof = 6
class RAFT_OMDAO(om.ExplicitComponent):
"""
RAFT OpenMDAO Wrapper API
"""
def initialize(self):
self.options.declare('modeling_options')
self.options.declare('turbine_options')
self.options.declare('moor... | en | 0.630849 | RAFT OpenMDAO Wrapper API # unpack options # frequency domain # turbine inputs # tower inputs # member inputs # ADD THIS AS AN OPTION IN WEIS # updated version to better handle 'diameters' between circular and rectangular members original version of handling diameters if scalar_d: self.add_i... | 2.484585 | 2 |
cogs/commands/misc/subnews.py | DiscordGIR/Bloo | 34 | 6622367 | <reponame>DiscordGIR/Bloo
import discord
from discord.commands import slash_command
from discord.ext import commands
import traceback
from data.services.guild_service import guild_service
from utils.config import cfg
from utils.logger import logger
from utils.context import BlooContext, PromptData
from utils.permissio... | import discord
from discord.commands import slash_command
from discord.ext import commands
import traceback
from data.services.guild_service import guild_service
from utils.config import cfg
from utils.logger import logger
from utils.context import BlooContext, PromptData
from utils.permissions.checks import Permissio... | en | 0.786572 | Posts a new subreddit news post Example usage ------------- /subnews # ensure the attached file is an image | 2.436906 | 2 |
week1/main.py | GalsenDev221/python.weekly | 5 | 6622368 | <filename>week1/main.py
# author @daoodaba975
# GalsenDev
n = int(input("Entrez le nombre pour lequel afficher le tableau de multiplication:"))
for i in range(1, 11):
print(n, "*", i, "=", n*i) | <filename>week1/main.py
# author @daoodaba975
# GalsenDev
n = int(input("Entrez le nombre pour lequel afficher le tableau de multiplication:"))
for i in range(1, 11):
print(n, "*", i, "=", n*i) | en | 0.468605 | # author @daoodaba975 # GalsenDev | 3.761944 | 4 |
tests/test_comment.py | EugeneZnm/BLOG-IT | 0 | 6622369 | import unittest
from app.models import Comments
class CommentsModelTest(unittest.TestCase):
def setUp(self):
self.new_comment = Comments(comment='interesting article')
# test instantiation of comment
def test_instance(self):
self.assertEqual(self.new_comment.comment, 'interest... | import unittest
from app.models import Comments
class CommentsModelTest(unittest.TestCase):
def setUp(self):
self.new_comment = Comments(comment='interesting article')
# test instantiation of comment
def test_instance(self):
self.assertEqual(self.new_comment.comment, 'interest... | en | 0.738595 | # test instantiation of comment # test comment saving # test getting comment by id # test comment deletion | 3.382008 | 3 |
src/setup.py | AchWoDu/msfs-parking-brake-toggler | 1 | 6622370 | <filename>src/setup.py
# Konfigurieren und auf shell aufrufen: python setup.py py2exe
from distutils.core import setup
import py2exe
setup(console=['main.py']) | <filename>src/setup.py
# Konfigurieren und auf shell aufrufen: python setup.py py2exe
from distutils.core import setup
import py2exe
setup(console=['main.py']) | de | 0.979531 | # Konfigurieren und auf shell aufrufen: python setup.py py2exe | 1.330258 | 1 |
livechat/tests/test_agent_rtm_client.py | livechat/lc-sdk-python | 5 | 6622371 | <reponame>livechat/lc-sdk-python
''' Tests for Agent RTM client. '''
# pylint: disable=E1120,W0621,C0103
import pytest
from livechat.agent.rtm.client import AgentRTM
def test_get_client_with_non_existing_version():
''' Test if ValueError raised for non-existing version. '''
with pytest.raises(ValueError) a... | ''' Tests for Agent RTM client. '''
# pylint: disable=E1120,W0621,C0103
import pytest
from livechat.agent.rtm.client import AgentRTM
def test_get_client_with_non_existing_version():
''' Test if ValueError raised for non-existing version. '''
with pytest.raises(ValueError) as exception:
AgentRTM.get... | en | 0.755082 | Tests for Agent RTM client. # pylint: disable=E1120,W0621,C0103 Test if ValueError raised for non-existing version. Test if created client opens and closes socket in default url. Test if created client can send request. Test if created client can send request. | 2.3156 | 2 |
install_list.py | dgabbe/rconfig | 2 | 6622372 | <reponame>dgabbe/rconfig<filename>install_list.py
# For rprofile.site.
scripts = [
[".Renviron", "dot-Renviron"],
["Rprofile.site", "Rprofile.site"]
]
| # For rprofile.site.
scripts = [
[".Renviron", "dot-Renviron"],
["Rprofile.site", "Rprofile.site"]
] | hr | 0.103399 | # For rprofile.site. | 1.172802 | 1 |
test_find_path.py | SanjoSolutions/planing | 0 | 6622373 | <gh_stars>0
import unittest
from find_path import find_path
class TestFindPath(unittest.TestCase):
def test_find_path(self):
space = (
(1, 0, 0, 0),
(0, 0, 0, 0),
(0, 0, 0, 2)
)
from_position = determine_from_position(space)
to_position = deter... | import unittest
from find_path import find_path
class TestFindPath(unittest.TestCase):
def test_find_path(self):
space = (
(1, 0, 0, 0),
(0, 0, 0, 0),
(0, 0, 0, 2)
)
from_position = determine_from_position(space)
to_position = determine_to_posi... | none | 1 | 3.671081 | 4 | |
maxatac/utilities/training_tools.py | tacazares/maxATAC | 5 | 6622374 | import random
import sys
from os import path
import tensorflow as tf
import numpy as np
import pandas as pd
from Bio.Seq import Seq
import threading
import pybedtools
import os
import glob
from maxatac.architectures.dcnn import get_dilated_cnn
from maxatac.utilities.constants import BP_RESOLUTION, BATCH_SIZE, CHR_POO... | import random
import sys
from os import path
import tensorflow as tf
import numpy as np
import pandas as pd
from Bio.Seq import Seq
import threading
import pybedtools
import os
import glob
from maxatac.architectures.dcnn import get_dilated_cnn
from maxatac.utilities.constants import BP_RESOLUTION, BATCH_SIZE, CHR_POO... | en | 0.782198 | This object will organize the input model parameters and initialize the maxATAC model The methods are: __get_interpretation_attributes: This will import the interpretation inputs if interpretation module is being used. __get_model: This will get the correct architecture and parameters based on the user i... | 2.135128 | 2 |
teraserver/python/opentera/db/models/TeraSite.py | introlab/opentera | 10 | 6622375 | from opentera.db.Base import db, BaseModel
from flask_sqlalchemy import event
class TeraSite(db.Model, BaseModel):
__tablename__ = 't_sites'
id_site = db.Column(db.Integer, db.Sequence('id_site_sequence'), primary_key=True, autoincrement=True)
site_name = db.Column(db.String, nullable=False, unique=True)
... | from opentera.db.Base import db, BaseModel
from flask_sqlalchemy import event
class TeraSite(db.Model, BaseModel):
__tablename__ = 't_sites'
id_site = db.Column(db.Integer, db.Sequence('id_site_sequence'), primary_key=True, autoincrement=True)
site_name = db.Column(db.String, nullable=False, unique=True)
... | en | 0.58679 | # site_devices = db.relationship("TeraDeviceSite") # Minimal information, delete can not be filtered # from opentera.db.models.TeraSession import TeraSession # TeraSession.delete_orphaned_sessions() # Creates admin and user roles for that site # # @event.listens_for(TeraSite, 'after_insert') # def site_inserted(mapper,... | 2.158138 | 2 |
apps/pep8.py | deeplook/streamlit-helpers | 0 | 6622376 | <reponame>deeplook/streamlit-helpers
import autopep8
import streamlit as st
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter
from .generic import Tool
class Pep8(Tool):
name = "PEP-8"
description = """
Reformat Python source code to ... | import autopep8
import streamlit as st
from pygments import highlight
from pygments.lexers import PythonLexer
from pygments.formatters import HtmlFormatter
from .generic import Tool
class Pep8(Tool):
name = "PEP-8"
description = """
Reformat Python source code to follow [PEP-8](https://www.python.org... | en | 0.576235 | Reformat Python source code to follow [PEP-8](https://www.python.org/dev/peps/pep-0008/) style guide. \ def example1(): ####This is a long comment. This should be wrapped to fit within 72 characters. some_tuple=( 1,2, 3,'a' ); some_variable={'long':'Long code lines should be wrapped within 79 characters.... | 3.015788 | 3 |
robots/migrations/0001_initial.py | zerolab/wagtail-robots | 13 | 6622377 | <filename>robots/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-27 05:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
initial = True... | <filename>robots/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-02-27 05:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
initial = True... | en | 0.714768 | # -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-02-27 05:02 | 1.859028 | 2 |
baekjoon/2587.py | jiyeoun/PS | 0 | 6622378 | <reponame>jiyeoun/PS
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
print((a+b+c+d+e)//5)
list=[a,b,c,d,e]
list.sort()
print(list[2]) | a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
print((a+b+c+d+e)//5)
list=[a,b,c,d,e]
list.sort()
print(list[2]) | none | 1 | 3.40285 | 3 | |
legal_advice_builder/__init__.py | prototypefund/django-legal-advice-builder | 4 | 6622379 | __title__ = 'Django Legal Advice Builder'
__version__ = '0.0.1'
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__license__ = 'Apache-2.0'
VERSION = __version__
| __title__ = 'Django Legal Advice Builder'
__version__ = '0.0.1'
__author__ = '<NAME>'
__email__ = '<EMAIL>'
__license__ = 'Apache-2.0'
VERSION = __version__
| none | 1 | 1.00451 | 1 | |
src/recommendation.py | acs6610987/CredibleWeb | 0 | 6622380 | <filename>src/recommendation.py
import webapp2
from basichandler import BasicHandler
from google.appengine.ext.db import stats
import random
import logging
from data_models import URLStorage
import urllib
import recommendAlg
class RandomRMDHandler(BasicHandler):
def get(self):
# m_stat = stats.KindStat.gql(... | <filename>src/recommendation.py
import webapp2
from basichandler import BasicHandler
from google.appengine.ext.db import stats
import random
import logging
from data_models import URLStorage
import urllib
import recommendAlg
class RandomRMDHandler(BasicHandler):
def get(self):
# m_stat = stats.KindStat.gql(... | en | 0.302979 | # m_stat = stats.KindStat.gql('WHERE kind_name = :1', 'URLStorage').get() # li = [random.randint(1, m_stat.count) for i in range(10)] # query = URLStorage.gql('WHERE index IN :1', li) # recommendations = [item for item in query] # m_stat = stats.KindStat.gql('WHERE kind_name = :1', 'U... | 2.45385 | 2 |
scripts/misc/detect_s2_partial_scenes.py | caitlinadams/deafrica-scripts | 3 | 6622381 | <filename>scripts/misc/detect_s2_partial_scenes.py
"""
Generate a report on scenes in deafrica-sentinel-2 bucket which have incomplete data
E.g command: python generate_report.py "s3://deafrica-sentinel-2-inventory/deafrica-sentinel-2/deafrica-sentinel-2-inventory/2020-11-24T00-00Z/manifest.json"
... | <filename>scripts/misc/detect_s2_partial_scenes.py
"""
Generate a report on scenes in deafrica-sentinel-2 bucket which have incomplete data
E.g command: python generate_report.py "s3://deafrica-sentinel-2-inventory/deafrica-sentinel-2/deafrica-sentinel-2-inventory/2020-11-24T00-00Z/manifest.json"
... | en | 0.757641 | Generate a report on scenes in deafrica-sentinel-2 bucket which have incomplete data E.g command: python generate_report.py "s3://deafrica-sentinel-2-inventory/deafrica-sentinel-2/deafrica-sentinel-2-inventory/2020-11-24T00-00Z/manifest.json" africa_account report.txt Compare Sen... | 3.016829 | 3 |
more/content_security/core.py | morepath/more.content_security | 1 | 6622382 | import base64
import os
from morepath import App
from morepath.request import Request
from more.content_security.policy import ContentSecurityPolicy
# see https://csp.withgoogle.com/docs/faq.html#generating-nonces
NONCE_LENGTH = 16
def random_nonce():
return base64.b64encode(os.urandom(NONCE_LENGTH)).decode("ut... | import base64
import os
from morepath import App
from morepath.request import Request
from more.content_security.policy import ContentSecurityPolicy
# see https://csp.withgoogle.com/docs/faq.html#generating-nonces
NONCE_LENGTH = 16
def random_nonce():
return base64.b64encode(os.urandom(NONCE_LENGTH)).decode("ut... | en | 0.856597 | # see https://csp.withgoogle.com/docs/faq.html#generating-nonces Provides access to a request-local version of the content security policy. This policy may be modified without having any effect on the default security policy. Generates a nonce that's random once per request, adds it to ... | 2.411345 | 2 |
algo/linear_regression.py | byscut/exercise | 0 | 6622383 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2022/4/25 2:45 下午
# @File : linear_regression.py
# @author : Akaya
# @Software: PyCharm
# linear_regression :
import matplotlib.pyplot as plt
from scipy import stats
x = [5, 7, 8, 7, 2, 17, 2, 9, 4, 11, 12, 9, 6]
y = [99, 86, 87, 88, 111, 86, 103, 87, ... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time : 2022/4/25 2:45 下午
# @File : linear_regression.py
# @author : Akaya
# @Software: PyCharm
# linear_regression :
import matplotlib.pyplot as plt
from scipy import stats
x = [5, 7, 8, 7, 2, 17, 2, 9, 4, 11, 12, 9, 6]
y = [99, 86, 87, 88, 111, 86, 103, 87, ... | zh | 0.171739 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Time : 2022/4/25 2:45 下午 # @File : linear_regression.py # @author : Akaya # @Software: PyCharm # linear_regression : | 3.496309 | 3 |
openfl/component/aggregation_functions/geometric_median.py | walteriviera/openfl | 0 | 6622384 | <gh_stars>0
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Geometric median module."""
from .interface import AggregationFunctionInterface
import numpy as np
from .weighted_average import weighted_average
def _geometric_median_objective(median, tensors, weights):
"""Compute... | # Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Geometric median module."""
from .interface import AggregationFunctionInterface
import numpy as np
from .weighted_average import weighted_average
def _geometric_median_objective(median, tensors, weights):
"""Compute geometric m... | en | 0.704767 | # Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 Geometric median module. Compute geometric median objective. Compute geometric median of tensors with weights using Weiszfeld's Algorithm. L2 distance between p1, p2, each of which is a list of nd-arrays. Geometric median aggregation. Agg... | 2.372564 | 2 |
SDT.py | Suhail-Athar/Python | 3 | 6622385 | import os
def sdt():
g = int (input("""What would you like to calculate:
Press 1 for Speed
Press 2 for Distance
Press 3 for Time
-- """))
if g == 1:
d = int (input('Enter the Distance: '))
t = int (input('Enter the Time: '))
S = d/t
print ('The Speed is: ',S... | import os
def sdt():
g = int (input("""What would you like to calculate:
Press 1 for Speed
Press 2 for Distance
Press 3 for Time
-- """))
if g == 1:
d = int (input('Enter the Distance: '))
t = int (input('Enter the Time: '))
S = d/t
print ('The Speed is: ',S... | en | 0.923023 | What would you like to calculate: Press 1 for Speed Press 2 for Distance Press 3 for Time -- | 4.085284 | 4 |
GIDI/Test/activeReactions/activeReactions.py | Mathnerd314/gidiplus | 0 | 6622386 | #! /usr/bin/env python
# <<BEGIN-copyright>>
# Copyright 2019, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: MIT
# <<END-copyright>>
from __future__ import print_function
from argparse import ArgumentParser
description = """Compares three ou... | #! /usr/bin/env python
# <<BEGIN-copyright>>
# Copyright 2019, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: MIT
# <<END-copyright>>
from __future__ import print_function
from argparse import ArgumentParser
description = """Compares three ou... | en | 0.734228 | #! /usr/bin/env python # <<BEGIN-copyright>> # Copyright 2019, Lawrence Livermore National Security, LLC. # See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: MIT # <<END-copyright>> Compares three output files from activeReactions. The first must be the output from running activeReactions with ... | 2.895972 | 3 |
bin/flaskserver.py | phplaboratory/madcore-ai | 0 | 6622387 | from flask import Flask, request, send_from_directory
app = Flask(__name__, root_path='/opt/www')
@app.route('/<path:path>')
def send_static(path):
return send_from_directory('', path)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=int("11180"), debug=True)
| from flask import Flask, request, send_from_directory
app = Flask(__name__, root_path='/opt/www')
@app.route('/<path:path>')
def send_static(path):
return send_from_directory('', path)
if __name__ == '__main__':
app.run(host="0.0.0.0", port=int("11180"), debug=True)
| none | 1 | 2.510664 | 3 | |
week5/Task3.py | mcv-m6-video/mcv-m6-2018-team1 | 0 | 6622388 | from utils import *
def task3():
pass | from utils import *
def task3():
pass | none | 1 | 0.884672 | 1 | |
test/db/test_dbing.py | reputage/bluepea | 0 | 6622389 | from __future__ import generator_stop
import os
import stat
import tempfile
import shutil
import binascii
import base64
import datetime
from collections import OrderedDict as ODict
try:
import simplejson as json
except ImportError:
import json
import libnacl
from ioflo.aid import timing
import pytest
from ... | from __future__ import generator_stop
import os
import stat
import tempfile
import shutil
import binascii
import base64
import datetime
from collections import OrderedDict as ODict
try:
import simplejson as json
except ImportError:
import json
import libnacl
from ioflo.aid import timing
import pytest
from ... | en | 0.667945 | # open named sub db named 'core' within env # txn is a Transaction object # keys and values are bytes # keys and values are bytes # re-fetch person0 Test putSigned and getSelfSigned # Create self signed resource # random seed used to generate private signing key #seed = libnacl.randombytes(libnacl.crypto_sign_SEEDBYTES... | 1.891338 | 2 |
App/pages/data_table.py | ericbdaniels/ddh-qaqc | 0 | 6622390 | <reponame>ericbdaniels/ddh-qaqc<gh_stars>0
import dash_bootstrap_components as dbc
import pandas as pd
from app import db_connection
from utils.misc import load_table
def table_view(table_name):
df = pd.read_sql(f"SELECT * from {table_name}", db_connection)
table = load_table(df)
return dbc.Container([ta... | import dash_bootstrap_components as dbc
import pandas as pd
from app import db_connection
from utils.misc import load_table
def table_view(table_name):
df = pd.read_sql(f"SELECT * from {table_name}", db_connection)
table = load_table(df)
return dbc.Container([table], fluid=True) | none | 1 | 2.28471 | 2 | |
main.py | aleehub/WallpapersWideSpider | 0 | 6622391 | from wallpaper import main
from categories import getCategoriesList
if __name__ == '__main__':
# 爬取开始页数
a = 1
# 爬取截止页数
b = 6
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36\
(KHTML, like Gecko) Chrome/75.0.3770.142... | from wallpaper import main
from categories import getCategoriesList
if __name__ == '__main__':
# 爬取开始页数
a = 1
# 爬取截止页数
b = 6
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36\
(KHTML, like Gecko) Chrome/75.0.3770.142... | zh | 0.532717 | # 爬取开始页数 # 爬取截止页数 | 2.313176 | 2 |
sendfile_osm_oauth_protector/__init__.py | geofabrik/osm-internal-auth | 2 | 6622392 | # flake8: noqa: F841
from .authentication_state import AuthenticationState
from .config import Config
from .key_manager import KeyManager
from .oauth_data_cookie import OAuthDataCookie
| # flake8: noqa: F841
from .authentication_state import AuthenticationState
from .config import Config
from .key_manager import KeyManager
from .oauth_data_cookie import OAuthDataCookie
| it | 0.184389 | # flake8: noqa: F841 | 1.11428 | 1 |
thingscoop/classifier.py | nishgaddam/thingscoop | 1 | 6622393 | import cPickle
import caffe
import cv2
import glob
import logging
import numpy
import os
class ImageClassifier(object):
def __init__(self, model, gpu_mode=False):
self.model = model
kwargs = {}
if self.model.get("image_dims"):
kwargs['image_dims'] = tuple(self.model.ge... | import cPickle
import caffe
import cv2
import glob
import logging
import numpy
import os
class ImageClassifier(object):
def __init__(self, model, gpu_mode=False):
self.model = model
kwargs = {}
if self.model.get("image_dims"):
kwargs['image_dims'] = tuple(self.model.ge... | none | 1 | 2.255943 | 2 | |
server.py | mcarval4/chat_socket | 0 | 6622394 | <reponame>mcarval4/chat_socket<gh_stars>0
import re
import Pyro4
# Administração de servidor de chat.
# Trata logins, logouts, canais e apelidos,
@Pyro4.expose
@Pyro4.behavior(instance_mode="single")
class ChatBox(object):
def __init__(self):
self.channels = {} # canais registrados {canal --> (apelido, ... | import re
import Pyro4
# Administração de servidor de chat.
# Trata logins, logouts, canais e apelidos,
@Pyro4.expose
@Pyro4.behavior(instance_mode="single")
class ChatBox(object):
def __init__(self):
self.channels = {} # canais registrados {canal --> (apelido, client callback) lista}
self.nicks... | pt | 0.923334 | # Administração de servidor de chat. # Trata logins, logouts, canais e apelidos, # canais registrados {canal --> (apelido, client callback) lista} # todos apelidos registrados # Função para criar um novo canal ou apelido # retorna todos os apelidos do canal # Função para saída do usuário e para limpar a lista com os us... | 2.974843 | 3 |
journey11/src/interface/agent.py | parrisma/AI-intuition | 0 | 6622395 | <gh_stars>0
import threading
from copy import deepcopy
from abc import abstractmethod
from pubsub import pub
from typing import List
from journey11.src.interface.notification import Notification
from journey11.src.interface.srcsink import SrcSink
from journey11.src.interface.tasknotification import TaskNotification
fro... | import threading
from copy import deepcopy
from abc import abstractmethod
from pubsub import pub
from typing import List
from journey11.src.interface.notification import Notification
from journey11.src.interface.srcsink import SrcSink
from journey11.src.interface.tasknotification import TaskNotification
from journey11.... | en | 0.921735 | Register all notification handlers & activities. Shut down Handle notification requests :param notification: The notification to be passed to the handler Create the unique topic for the agent that it will listen on for work (task) deliveries that it has requested from the task-pool # do potentially high... | 1.95329 | 2 |
src/diffbank/constants.py | adam-coogan/diffbank | 6 | 6622396 | <reponame>adam-coogan/diffbank<gh_stars>1-10
"""
Various constants. ``diffbank`` uses SI units throughout.
"""
MSUN = 1.98855e30 # kg
"""Solar mass"""
G = 6.674e-11 # m^3 / kg / s^2
"""Newton's gravitational constant"""
C = 299792458.0 # m / s
"""Speed of light"""
| """
Various constants. ``diffbank`` uses SI units throughout.
"""
MSUN = 1.98855e30 # kg
"""Solar mass"""
G = 6.674e-11 # m^3 / kg / s^2
"""Newton's gravitational constant"""
C = 299792458.0 # m / s
"""Speed of light""" | en | 0.730888 | Various constants. ``diffbank`` uses SI units throughout. # kg Solar mass # m^3 / kg / s^2 Newton's gravitational constant # m / s Speed of light | 1.517907 | 2 |
doc/argument_rotation.py | ilopata1/matplotlib-scalebar | 92 | 6622397 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
from matplotlib_scalebar.scalebar import ScaleBar
with cbook.get_sample_data("s1045.ima.gz") as dfile:
im = np.frombuffer(dfile.read(), np.uint16).reshape((256, 256))
fig, ax = plt.subplots()
ax.axis("off")
ax.imshow(im, cmap="gr... | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
from matplotlib_scalebar.scalebar import ScaleBar
with cbook.get_sample_data("s1045.ima.gz") as dfile:
im = np.frombuffer(dfile.read(), np.uint16).reshape((256, 256))
fig, ax = plt.subplots()
ax.axis("off")
ax.imshow(im, cmap="gr... | none | 1 | 2.634942 | 3 | |
hockey_scraper/json_schedule.py | alex-gable/Hockey-Scraper | 0 | 6622398 | <filename>hockey_scraper/json_schedule.py
"""
This module contains functions to scrape the json schedule for any games or date range
"""
import json
import time
import datetime
import hockey_scraper.shared as shared
def get_schedule(date_from, date_to):
"""
Scrapes games in date range
Ex: https://statsap... | <filename>hockey_scraper/json_schedule.py
"""
This module contains functions to scrape the json schedule for any games or date range
"""
import json
import time
import datetime
import hockey_scraper.shared as shared
def get_schedule(date_from, date_to):
"""
Scrapes games in date range
Ex: https://statsap... | en | 0.770102 | This module contains functions to scrape the json schedule for any games or date range Scrapes games in date range Ex: https://statsapi.web.nhl.com/api/v1/schedule?startDate=2010-10-03&endDate=2011-06-20 :param date_from: scrape from this date :param date_to: scrape until this date :return: ra... | 3.74132 | 4 |
pystanley/tests/mockup.py | claudiomattera/pystanley | 0 | 6622399 | # Copyright <NAME> 2019.
# Copyright Center for Energy Informatics 2018.
# Distributed under the MIT License.
# See accompanying file License.txt, or online at
# https://opensource.org/licenses/MIT
import typing
from pystanley.types import JsonType
from pystanley.transport import TransportInterface
class DummyTrans... | # Copyright <NAME> 2019.
# Copyright Center for Energy Informatics 2018.
# Distributed under the MIT License.
# See accompanying file License.txt, or online at
# https://opensource.org/licenses/MIT
import typing
from pystanley.types import JsonType
from pystanley.transport import TransportInterface
class DummyTrans... | en | 0.710537 | # Copyright <NAME> 2019. # Copyright Center for Energy Informatics 2018. # Distributed under the MIT License. # See accompanying file License.txt, or online at # https://opensource.org/licenses/MIT docstring for DummyTransportInterface | 2.158598 | 2 |
cibyl/outputs/cli/ci/system/impls/jobs/serialized.py | rhos-infra/cibyl | 3 | 6622400 | """
# Copyright 2022 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | """
# Copyright 2022 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | en | 0.701971 | # Copyright 2022 Red Hat # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ... | 2.177378 | 2 |
setup.py | socialwifi/flask-oauthres | 4 | 6622401 | <filename>setup.py
import pathlib
import pkg_resources
from setuptools import setup
from setuptools import find_packages
with pathlib.Path('base_requirements.txt').open() as requirements_txt:
install_requires = [
str(requirement) for requirement in pkg_resources.parse_requirements(requirements_txt)
]
... | <filename>setup.py
import pathlib
import pkg_resources
from setuptools import setup
from setuptools import find_packages
with pathlib.Path('base_requirements.txt').open() as requirements_txt:
install_requires = [
str(requirement) for requirement in pkg_resources.parse_requirements(requirements_txt)
]
... | none | 1 | 1.755714 | 2 | |
content/Displayer.py | FrancoisGoualard/Lunar_Landscape_Detection | 0 | 6622402 | <reponame>FrancoisGoualard/Lunar_Landscape_Detection<gh_stars>0
import csv
import numpy
import matplotlib.patches as patches
import matplotlib.pyplot as plt
from PIL import Image
from config import DATAPATH
class Displayer:
project_dir = DATAPATH
def __init__(self, bounding_boxes=[], fileNumber=""):
... | import csv
import numpy
import matplotlib.patches as patches
import matplotlib.pyplot as plt
from PIL import Image
from config import DATAPATH
class Displayer:
project_dir = DATAPATH
def __init__(self, bounding_boxes=[], fileNumber=""):
self.bounding_boxes_list = bounding_boxes
self.file = fi... | en | 0.316937 | # Skip the header | 2.781812 | 3 |
designate-8.0.0/designate/tests/unit/test_mdns/test_handler.py | scottwedge/OpenStack-Stein | 0 | 6622403 | <gh_stars>0
# Copyright 2014 Rackspace Inc.
#
# Author: <NAME> <<EMAIL>>
#
# 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 require... | # Copyright 2014 Rackspace Inc.
#
# Author: <NAME> <<EMAIL>>
#
# 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 applica... | en | 0.859784 | # Copyright 2014 Rackspace Inc. # # Author: <NAME> <<EMAIL>> # # 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 applica... | 2.147662 | 2 |
atuproot/ReaderComposite.py | shane-breeze/atuproot | 0 | 6622404 | from alphatwirl.loop import ReaderComposite
class CustomReaderComposite(ReaderComposite):
def merge(self, other):
if not hasattr(other, "readers"):
return
super(CustomReaderComposite, self).merge(other)
| from alphatwirl.loop import ReaderComposite
class CustomReaderComposite(ReaderComposite):
def merge(self, other):
if not hasattr(other, "readers"):
return
super(CustomReaderComposite, self).merge(other)
| none | 1 | 2.336106 | 2 | |
ichnaea/taskapp/tests.py | mikiec84/ichnaea | 348 | 6622405 | from inspect import getmembers
from celery import signals
from ichnaea.taskapp.task import BaseTask
class TestBeat(object):
def test_tasks(self, celery, tmpdir):
filename = str(tmpdir / "celerybeat-schedule")
beat_app = celery.Beat()
beat = beat_app.Service(app=celery, schedule_filename=... | from inspect import getmembers
from celery import signals
from ichnaea.taskapp.task import BaseTask
class TestBeat(object):
def test_tasks(self, celery, tmpdir):
filename = str(tmpdir / "celerybeat-schedule")
beat_app = celery.Beat()
beat = beat_app.Service(app=celery, schedule_filename=... | en | 0.810397 | # Parses the schedule as a side-effect # Import tasks after beat startup, to ensure beat_init correctly loads # configured Celery imports. | 1.996508 | 2 |
demo/demo-logging.py | Duplexes/py_console | 13 | 6622406 | <reponame>Duplexes/py_console
from pyco import print_message, user_input, logging
from pyco.color import Fore
logging.clear_log()
logging.enable_message_logging = True
logging.log("Log file gets created automatically", "[Prefix]")
print_message("Error messages logged by default", "[ERROR]")
logging.log("Log entry with... | from pyco import print_message, user_input, logging
from pyco.color import Fore
logging.clear_log()
logging.enable_message_logging = True
logging.log("Log file gets created automatically", "[Prefix]")
print_message("Error messages logged by default", "[ERROR]")
logging.log("Log entry without a prefix")
logging.enable_... | none | 1 | 2.540855 | 3 | |
vv_core_inference/make_yukarin_sosoa_forwarder.py | Hiroshiba/vv_core_inference | 12 | 6622407 | <gh_stars>10-100
from pathlib import Path
from typing import List, Optional
import math
import numpy
import torch
import yaml
from espnet_pytorch_library.tacotron2.decoder import Postnet
from torch import Tensor, nn
from torch.nn.utils.rnn import pad_sequence
from yukarin_sosoa.config import Config
from yukarin_sosoa.... | from pathlib import Path
from typing import List, Optional
import math
import numpy
import torch
import yaml
from espnet_pytorch_library.tacotron2.decoder import Postnet
from torch import Tensor, nn
from torch.nn.utils.rnn import pad_sequence
from yukarin_sosoa.config import Config
from yukarin_sosoa.network.predictor... | en | 0.752003 | Variant of espnet_pytorch_library/transformer/embedding.py#RelPositionalEncoding copyright 2019 <NAME> apache 2.0 (http://www.apache.org/licenses/license-2.0) Construct an PositionalEncoding object. Add positional encoding. Args: x (torch.Tensor): Input tensor (batch, time, `*`). ... | 2.387067 | 2 |
src/multipleInstanceLearning/generateSimilarityMatrices.py | UMCUGenetics/svMIL | 0 | 6622408 | """
The goal of this script is to generate the similarity matrices for MIL
The similarity matrices are pre-generated for the CV type that these will be used for.
There is:
- leave-one-chromosome-out CV
- leave-one-patient-out CV
- leave-bags-out CV
- the similarity matrix on the whole dataset (used for fe... | """
The goal of this script is to generate the similarity matrices for MIL
The similarity matrices are pre-generated for the CV type that these will be used for.
There is:
- leave-one-chromosome-out CV
- leave-one-patient-out CV
- leave-bags-out CV
- the similarity matrix on the whole dataset (used for fe... | en | 0.863508 | The goal of this script is to generate the similarity matrices for MIL
The similarity matrices are pre-generated for the CV type that these will be used for.
There is:
- leave-one-chromosome-out CV
- leave-one-patient-out CV
- leave-bags-out CV
- the similarity matrix on the whole dataset (used for feature ... | 3.027606 | 3 |
tests/unit/util/test_split_host_port.py | denssk/backup | 69 | 6622409 | import pytest
from twindb_backup.util import split_host_port
@pytest.mark.parametrize('pair, host, port', [
(
"10.20.31.1:3306",
"10.20.31.1",
3306
),
(
"10.20.31.1",
"10.20.31.1",
None
),
(
"10.20.31.1:",
"10.20.31.1",
None
... | import pytest
from twindb_backup.util import split_host_port
@pytest.mark.parametrize('pair, host, port', [
(
"10.20.31.1:3306",
"10.20.31.1",
3306
),
(
"10.20.31.1",
"10.20.31.1",
None
),
(
"10.20.31.1:",
"10.20.31.1",
None
... | none | 1 | 2.758433 | 3 | |
src/support/kernels/__init__.py | EuroPOND/deformetrica | 1 | 6622410 | from enum import Enum
from support.kernels.abstract_kernel import AbstractKernel
class Type(Enum):
from support.kernels.torch_kernel import TorchKernel
from support.kernels.keops_kernel import KeopsKernel
from support.kernels.torch_cuda_kernel import TorchCudaKernel
NO_KERNEL = None
TORCH = Torc... | from enum import Enum
from support.kernels.abstract_kernel import AbstractKernel
class Type(Enum):
from support.kernels.torch_kernel import TorchKernel
from support.kernels.keops_kernel import KeopsKernel
from support.kernels.torch_cuda_kernel import TorchCudaKernel
NO_KERNEL = None
TORCH = Torc... | en | 0.614609 | Return an instance of a kernel corresponding to the requested kernel_type # turn enum string to enum object # chars to be replaced for normalization | 2.948452 | 3 |
cst/kostrov.py | gely/coseis | 7 | 6622411 | <filename>cst/kostrov.py
"""
Kostrov circular expanding crack analytical solution.
"""
import numpy
def cee_integrand(x, a2, b2):
return (
((x + 0.5 * b2) ** 2.0 - x * numpy.sqrt((x + b2) * (x + a2))) /
((x + 1.0) * (x + 1.0) * numpy.sqrt(x + b2))
)
def cee_integral(a2, b2):
import scipy... | <filename>cst/kostrov.py
"""
Kostrov circular expanding crack analytical solution.
"""
import numpy
def cee_integrand(x, a2, b2):
return (
((x + 0.5 * b2) ** 2.0 - x * numpy.sqrt((x + b2) * (x + a2))) /
((x + 1.0) * (x + 1.0) * numpy.sqrt(x + b2))
)
def cee_integral(a2, b2):
import scipy... | en | 0.691787 | Kostrov circular expanding crack analytical solution. a: Ratio of rupture to P-wave velocity, vrup/vp. b: Ratio of rupture to S-wave velocity, vrup/vs. rho: density vp: P-wave speed vs: S-wave speed vrup: rupture velocity dtau: stress drop r: hypocenter distance t: array of reduced-time samp... | 2.621117 | 3 |
appconfig/tasks/letsencrypt.py | Bibiko/appconfig | 0 | 6622412 | <filename>appconfig/tasks/letsencrypt.py
from fabric.api import sudo
from fabtools import require
from appconfig import APPS
from appconfig.config import App
from appconfig import util
from fabtools.system import distrib_codename
def require_certbot():
require.deb.package('software-properties-common')
util.... | <filename>appconfig/tasks/letsencrypt.py
from fabric.api import sudo
from fabtools import require
from appconfig import APPS
from appconfig.config import App
from appconfig import util
from fabtools.system import distrib_codename
def require_certbot():
require.deb.package('software-properties-common')
util.... | en | 0.824112 | # If an App instance is passed, we lookup its domain attribute: | 2.06899 | 2 |
sklearn/plot_classification.py | aidiary/PRML | 93 | 6622413 | #coding:utf-8
import numpy as np
import pylab as pl
from matplotlib.colors import ListedColormap
from sklearn import neighbors, datasets
"""k-NNのカラーマップ表示"""
n_neighbors = 15
# irisデータをインポート
iris = datasets.load_iris()
X = iris.data[:, :2]
y = iris.target
# メッシュのステップサイズ
h = 0.02
# カラーマップ
cmap_light = ListedColormap... | #coding:utf-8
import numpy as np
import pylab as pl
from matplotlib.colors import ListedColormap
from sklearn import neighbors, datasets
"""k-NNのカラーマップ表示"""
n_neighbors = 15
# irisデータをインポート
iris = datasets.load_iris()
X = iris.data[:, :2]
y = iris.target
# メッシュのステップサイズ
h = 0.02
# カラーマップ
cmap_light = ListedColormap... | ja | 0.999809 | #coding:utf-8 k-NNのカラーマップ表示 # irisデータをインポート # メッシュのステップサイズ # カラーマップ # 分類器を学習 # データより少し広くなるように描画範囲を決定 # 範囲をメッシュに区切ってその座標での分類結果Zを求める # 分類結果を元に色を割り当てて描画 # 訓練データをプロット | 2.711535 | 3 |
app/views/setupview.py | nandakoryaaa/pypy | 0 | 6622414 | <gh_stars>0
from app.views.logoview import LogoView
from app.views.menuview import MenuView
class SetupView(LogoView):
def __init__(self, graphics, model):
super().__init__(graphics, model)
self.level_num = 0
self.apple_count = 0
self.menu_view = MenuView(graphics, model)
self.x = self.center_axi... | from app.views.logoview import LogoView
from app.views.menuview import MenuView
class SetupView(LogoView):
def __init__(self, graphics, model):
super().__init__(graphics, model)
self.level_num = 0
self.apple_count = 0
self.menu_view = MenuView(graphics, model)
self.x = self.center_axis(0, self.wi... | none | 1 | 2.461587 | 2 | |
reptile/train.py | mkhodak/ARUBA | 7 | 6622415 | import json
import os; os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import pdb
import pickle
import random
import sys
from glob import glob
from operator import itemgetter
import tensorflow as tf
try:
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
except AttributeError:
tf.logging.set_verbosity(tf.l... | import json
import os; os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import pdb
import pickle
import random
import sys
from glob import glob
from operator import itemgetter
import tensorflow as tf
try:
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
except AttributeError:
tf.logging.set_verbosity(tf.l... | none | 1 | 2.157921 | 2 | |
config/appdaemon/apps/light_with_motion_and_hue_switch.py | azogue/hassio_config | 18 | 6622416 | <reponame>azogue/hassio_config
# -*- coding: utf-8 -*-
"""
Appdaemon app for motion + switch control of light in a room.
"""
from time import monotonic
from typing import Any, Dict, Optional, Tuple
import appdaemon.plugins.hass.hassapi as hass
LOGGER = "motion_log"
EVENT_LOG_LEVEL = "DEBUG"
RWL_BUTTONS = {
1000:... | # -*- coding: utf-8 -*-
"""
Appdaemon app for motion + switch control of light in a room.
"""
from time import monotonic
from typing import Any, Dict, Optional, Tuple
import appdaemon.plugins.hass.hassapi as hass
LOGGER = "motion_log"
EVENT_LOG_LEVEL = "DEBUG"
RWL_BUTTONS = {
1000: "1_click",
2000: "2_click"... | en | 0.810556 | # -*- coding: utf-8 -*- Appdaemon app for motion + switch control of light in a room. # noinspection PyClassHasNoInit App to automate lights in a room with: - One or more motion sensors - A Hue Dimmer Switch for manual control, with priority over automatic. Set up appdaemon app. # Add listener to check light of... | 2.521199 | 3 |
cm2metrics/cm_test.py | FisherDock/m2metrics | 0 | 6622417 | <gh_stars>0
# MIT License
# Copyright (c) 2021 <NAME>(<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, ... | # MIT License
# Copyright (c) 2021 <NAME>(<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merg... | en | 0.754102 | # MIT License # Copyright (c) 2021 <NAME>(<EMAIL>) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merg... | 2.526164 | 3 |
agnes/common/tests/CNN_Discrete.py | rotinov/CITUS | 24 | 6622418 | import agnes
def test_config():
return dict(
timesteps=128*4,
nsteps=128,
nminibatches=4,
gamma=0.99,
lam=0.95,
noptepochs=4,
max_grad_norm=0.5,
learning_rate=2.5e-4,
cliprange=0.1,
vf_coef=0.5,
ent_coef=.01,
bptt=16
... | import agnes
def test_config():
return dict(
timesteps=128*4,
nsteps=128,
nminibatches=4,
gamma=0.99,
lam=0.95,
noptepochs=4,
max_grad_norm=0.5,
learning_rate=2.5e-4,
cliprange=0.1,
vf_coef=0.5,
ent_coef=.01,
bptt=16
... | none | 1 | 2.167032 | 2 | |
markovflow/kernels/__init__.py | prakharverma/markovflow | 17 | 6622419 | #
# Copyright (c) 2021 The Markovflow Contributors.
#
# 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... | #
# Copyright (c) 2021 The Markovflow Contributors.
#
# 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... | en | 0.852365 | # # Copyright (c) 2021 The Markovflow Contributors. # # 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... | 0.965442 | 1 |
imgs/urls.py | swap-10/ImageApp | 0 | 6622420 | from django.contrib import admin
from django.urls import path, reverse
from django.urls.resolvers import URLPattern
from . import views
urlpatterns = [
path('', views.images, name='images'),
path('upload/', views.upload, name="upload"),
path('<int:id>/delete', views.delete),
] | from django.contrib import admin
from django.urls import path, reverse
from django.urls.resolvers import URLPattern
from . import views
urlpatterns = [
path('', views.images, name='images'),
path('upload/', views.upload, name="upload"),
path('<int:id>/delete', views.delete),
] | none | 1 | 1.629021 | 2 | |
doc/en_US/tutorials/config.py | flyingTan/QuantQuant | 14 | 6622421 | ############## 1. Model ###############
model = dict(
type='ImageClassifier',
backbone=dict(
type='ResNet',
depth=18,
num_stages=4,
out_indices=(3, ),
style='pytorch'),
neck=dict(type='GlobalAveragePooling'),
head=dict(
type='LinearClsHead',
num_cl... | ############## 1. Model ###############
model = dict(
type='ImageClassifier',
backbone=dict(
type='ResNet',
depth=18,
num_stages=4,
out_indices=(3, ),
style='pytorch'),
neck=dict(type='GlobalAveragePooling'),
head=dict(
type='LinearClsHead',
num_cl... | de | 0.370191 | ############## 1. Model ############### ############## 2. Dataset setting ############### # dataset settings # replace `data/val` with `data/test` for standard test ############## 3. quantization setting ############### ############## 4. optimizer, log, workdir, and etc ############### # checkpoint saving # optimizer #... | 2.090496 | 2 |
oas_dev/notebooks/global_comparisons/01_maps/01-02-lifetimes.py | sarambl/OAS-DEV | 0 | 6622422 | <filename>oas_dev/notebooks/global_comparisons/01_maps/01-02-lifetimes.py
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.2
# kernelspec:
# display_name: Python 3
# language: python
# ... | <filename>oas_dev/notebooks/global_comparisons/01_maps/01-02-lifetimes.py
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.3.2
# kernelspec:
# display_name: Python 3
# language: python
# ... | en | 0.343366 | # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.3.2 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% # load and autoreload # noinspection PyBroadExcep... | 1.834343 | 2 |
python_exercises/Curso_em_video/ex034.py | Matheus-IT/lang-python-related | 0 | 6622423 | <gh_stars>0
sal = float(input('\033[35mQual o seu salário? R$\033[m'))
if sal <= 1250:
aumento = sal + (0.15 * sal)
else:
aumento = sal + (0.10 * sal)
print('\033[1;35mQuem ganhava R${:.2f} passa a ganhar R${:.2f} agora\033[m'.format(sal, aumento))
| sal = float(input('\033[35mQual o seu salário? R$\033[m'))
if sal <= 1250:
aumento = sal + (0.15 * sal)
else:
aumento = sal + (0.10 * sal)
print('\033[1;35mQuem ganhava R${:.2f} passa a ganhar R${:.2f} agora\033[m'.format(sal, aumento)) | none | 1 | 3.479313 | 3 | |
code/model_kit/layer_norm.py | jiwoongim/IMsML | 0 | 6622424 | import os, sys
import numpy as np
import tensorflow as tf
from utils.nn_utils import *
from utils.tf_utils import *
TINY = 1e-5
class Layer_Norm(object):
def __init__(self, D, M, name, numpy_rng):
self.W = initialize_weight(D, M, name, numpy_rng, 'uniform')
self.eta = theano.s... | import os, sys
import numpy as np
import tensorflow as tf
from utils.nn_utils import *
from utils.tf_utils import *
TINY = 1e-5
class Layer_Norm(object):
def __init__(self, D, M, name, numpy_rng):
self.W = initialize_weight(D, M, name, numpy_rng, 'uniform')
self.eta = theano.s... | none | 1 | 2.370528 | 2 | |
fuzzinator/formatter/__init__.py | akosthekiss/fuzzinator | 202 | 6622425 | # Copyright (c) 2018-2021 <NAME>, <NAME>.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from .chevron_formatter import ChevronFormatter
from .decoder_decorator impor... | # Copyright (c) 2018-2021 <NAME>, <NAME>.
#
# Licensed under the BSD 3-Clause License
# <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>.
# This file may not be copied, modified, or distributed except
# according to those terms.
from .chevron_formatter import ChevronFormatter
from .decoder_decorator impor... | en | 0.759298 | # Copyright (c) 2018-2021 <NAME>, <NAME>. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. | 0.987339 | 1 |
src/dataset/augmentation.py | rs1004/yolo | 0 | 6622426 | <reponame>rs1004/yolo
import torch
from torchvision.transforms.functional import hflip
from torchvision.transforms import (
Compose as C,
ToTensor as TT,
ColorJitter as CJ
)
class Compose(C):
"""This is an extension of torchvision.transforms.Compose so that it can be applied to 'image' and 'gt'.
A... | import torch
from torchvision.transforms.functional import hflip
from torchvision.transforms import (
Compose as C,
ToTensor as TT,
ColorJitter as CJ
)
class Compose(C):
"""This is an extension of torchvision.transforms.Compose so that it can be applied to 'image' and 'gt'.
Args:
transform... | en | 0.744135 | This is an extension of torchvision.transforms.Compose so that it can be applied to 'image' and 'gt'. Args: transforms (list of ``Transform`` objects): list of transforms to compose. This is an extension of torchvision.transforms.ToTensor so that it can be applied to 'image' and 'gt'. Args: img ... | 2.507135 | 3 |
empower/vbsp/ue_measurements/ue_measurements.py | gzaccaria/empower-runtime | 0 | 6622427 | <reponame>gzaccaria/empower-runtime
#!/usr/bin/env python3
#
# Copyright (c) 2016 <NAME>
#
# 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
#
# ... | #!/usr/bin/env python3
#
# Copyright (c) 2016 <NAME>
#
# 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... | en | 0.750651 | #!/usr/bin/env python3 # # Copyright (c) 2016 <NAME> # # 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... | 1.507045 | 2 |
src/intervals/intervaln.py | yuanagain/seniorthesis | 0 | 6622428 | <filename>src/intervals/intervaln.py
"""
Defines a basic n-dimensional interval and implements basic operations
on said intervals.
Author:
<NAME>
Princeton University
"""
from __future__ import division
from interval import interval, inf, imath
import operator
class IntervalN:
def __init__(self, x = [interval(... | <filename>src/intervals/intervaln.py
"""
Defines a basic n-dimensional interval and implements basic operations
on said intervals.
Author:
<NAME>
Princeton University
"""
from __future__ import division
from interval import interval, inf, imath
import operator
class IntervalN:
def __init__(self, x = [interval(... | en | 0.716059 | Defines a basic n-dimensional interval and implements basic operations on said intervals. Author: <NAME> Princeton University Create defensive copy Returns a clone of this interval Returns the midpoint of the hypercube Returns whether or not this interval is zero Returns convex hull Adds two hypercubes Multiplies two... | 3.680801 | 4 |
Programas_Capitulo_06/Cap06_pagina_147_leer_datos_teclado.py | rojassergio/Aprendiendo-a-programar-en-Python-con-mi-computador | 17 | 6622429 | # -*- coding: utf-8 -*-
'''
@author: <NAME>
@contact: <EMAIL>
--------------------------
Contenido bajo
Atribución-NoComercial-CompartirIgual 3.0 Venezuela (CC BY-NC-SA 3.0 VE)
http://creativecommons.org/licenses/by-nc-sa/3.0/ve/
Creado en abril 23, 2016
'''
def myinput():
"""
Esta función permite leer da... | # -*- coding: utf-8 -*-
'''
@author: <NAME>
@contact: <EMAIL>
--------------------------
Contenido bajo
Atribución-NoComercial-CompartirIgual 3.0 Venezuela (CC BY-NC-SA 3.0 VE)
http://creativecommons.org/licenses/by-nc-sa/3.0/ve/
Creado en abril 23, 2016
'''
def myinput():
"""
Esta función permite leer da... | es | 0.642887 | # -*- coding: utf-8 -*- @author: <NAME> @contact: <EMAIL> -------------------------- Contenido bajo Atribución-NoComercial-CompartirIgual 3.0 Venezuela (CC BY-NC-SA 3.0 VE) http://creativecommons.org/licenses/by-nc-sa/3.0/ve/ Creado en abril 23, 2016 Esta función permite leer datos desde el teclado sin ocuparnos... | 3.947926 | 4 |
client/minio.py | jupadhya1/Odometry_Signal_Anomaly | 0 | 6622430 | <reponame>jupadhya1/Odometry_Signal_Anomaly
import logging
import pickle
import json
from io import BytesIO, StringIO
from typing import Union, Dict, List
import pandas as pd
from minio import Minio
from minio.error import MinioException
class MinioClient(Minio):
""" A minio client adding extra featu... | import logging
import pickle
import json
from io import BytesIO, StringIO
from typing import Union, Dict, List
import pandas as pd
from minio import Minio
from minio.error import MinioException
class MinioClient(Minio):
""" A minio client adding extra features in existing minio client
Paramete... | en | 0.729478 | A minio client adding extra features in existing minio client
Parameters
----------
Minio ([type]): the actual client check if bucket exists otherwise create it
Parameters
----------
bucket_name (str): name of bucket (s3 bucket) writes pandas dataframe to minio bucket with ... | 2.63578 | 3 |
python/rbf/writer/htmlwriter.py | dandyvica/rbf | 0 | 6622431 | import os
import sys
from rbf.field import Field
from rbf.record import Record
#from rbf.config import settings
"""
set of methods used to print out record data as an HTML file
"""
class HtmlWriter:
"""
create a new HTML writer object
:param output: text file name for output
:type output: str
... | import os
import sys
from rbf.field import Field
from rbf.record import Record
#from rbf.config import settings
"""
set of methods used to print out record data as an HTML file
"""
class HtmlWriter:
"""
create a new HTML writer object
:param output: text file name for output
:type output: str
... | en | 0.581668 | #from rbf.config import settings set of methods used to print out record data as an HTML file create a new HTML writer object :param output: text file name for output :type output: str :example: :: htmlwriter = HtmlWriter("myfile.html") #settings.logger.info("creating output file {0}".format(... | 3.026021 | 3 |
Examples/More/Stream/in_stream_with_non_looping_out_stream.py | iconservo/labjack-ljm | 0 | 6622432 | <reponame>iconservo/labjack-ljm
"""
Demonstrates setting up stream-in with stream-out that continuously updates.
Streams in while streaming out arbitrary values. These arbitrary stream-out
values act on DAC0 to alternate between increasing the voltage from 0 to 2.5 and
decreasing from 5.0 to 2.5 on (approximately... | """
Demonstrates setting up stream-in with stream-out that continuously updates.
Streams in while streaming out arbitrary values. These arbitrary stream-out
values act on DAC0 to alternate between increasing the voltage from 0 to 2.5 and
decreasing from 5.0 to 2.5 on (approximately). Though these values are initi... | en | 0.84207 | Demonstrates setting up stream-in with stream-out that continuously updates.
Streams in while streaming out arbitrary values. These arbitrary stream-out
values act on DAC0 to alternate between increasing the voltage from 0 to 2.5 and
decreasing from 5.0 to 2.5 on (approximately). Though these values are initially
... | 3.363927 | 3 |
users/models.py | aanu1143/chat-app | 0 | 6622433 | <filename>users/models.py
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.urls import reverse
class CustomUser(AbstractUser):
status = models.CharField(max_length=50, null=True)
def get_absolute_url(self):
return reverse('profile_detail',args=[str(self.... | <filename>users/models.py
from django.contrib.auth.models import AbstractUser
from django.db import models
from django.urls import reverse
class CustomUser(AbstractUser):
status = models.CharField(max_length=50, null=True)
def get_absolute_url(self):
return reverse('profile_detail',args=[str(self.... | none | 1 | 2.405022 | 2 | |
section4: methods and functions/1-functions.py | rpotter12/learning-python | 2 | 6622434 | # A function in Python is defined by a def statement.
# The general syntax looks like this: def function-name(Parameter list): statements, i.e. the function body.
# The parameter list consists of none or more parameters.
# Parameters are called arguments, if the function is called.
# functions allow us to create blo... | # A function in Python is defined by a def statement.
# The general syntax looks like this: def function-name(Parameter list): statements, i.e. the function body.
# The parameter list consists of none or more parameters.
# Parameters are called arguments, if the function is called.
# functions allow us to create blo... | en | 0.806184 | # A function in Python is defined by a def statement. # The general syntax looks like this: def function-name(Parameter list): statements, i.e. the function body. # The parameter list consists of none or more parameters. # Parameters are called arguments, if the function is called. # functions allow us to create blocks... | 4.155286 | 4 |
hackerrank/algorithms/contests/projecteuler/pdone/32.py | harry-7/mycodes | 1 | 6622435 | <reponame>harry-7/mycodes
"""
Author: <NAME>
Handle:harry7
"""
#!/usr/bin/python
''' From O'Reilly's Python Cookbook '''
def _combinators(_handle, items, n):
if n==0:
yield []
return
for i, item in enumerate(items):
this_one = [ item ]
for cc in _combinators(_handle, _ha... | """
Author: <NAME>
Handle:harry7
"""
#!/usr/bin/python
''' From O'Reilly's Python Cookbook '''
def _combinators(_handle, items, n):
if n==0:
yield []
return
for i, item in enumerate(items):
this_one = [ item ]
for cc in _combinators(_handle, _handle(items, i), n-1):
... | en | 0.716947 | Author: <NAME> Handle:harry7 #!/usr/bin/python From O'Reilly's Python Cookbook take n distinct items, order matters take n distinct items, order is irrelevant take n (not necessarily distinct) items, order matters take all items, order matters #print a,b,c | 3.579591 | 4 |
notifications/signals.py | Natureshadow/django-notifs | 0 | 6622436 | <reponame>Natureshadow/django-notifs
"""Defines and listens to notification signals."""
import warnings
from django.dispatch import Signal, receiver
from . import NotificationError
from .models import Notification
from .tasks import send_notification
# Expected arguments; 'source', 'source_display_name', 'recipien... | """Defines and listens to notification signals."""
import warnings
from django.dispatch import Signal, receiver
from . import NotificationError
from .models import Notification
from .tasks import send_notification
# Expected arguments; 'source', 'source_display_name', 'recipient', 'action',
# 'category' 'obj', 'ur... | en | 0.692155 | Defines and listens to notification signals. # Expected arguments; 'source', 'source_display_name', 'recipient', 'action', # 'category' 'obj', 'url', 'short_description', 'extra_data', 'silent', # 'channels' # Expected arguments: 'notify_id', 'recipient' Notify signal receiver. # make fresh copy and retain kwargs # If ... | 2.423847 | 2 |
pyprob/nn/proposal_categorical_categorical.py | ammunk/pyprob | 2 | 6622437 | <filename>pyprob/nn/proposal_categorical_categorical.py
import torch
import torch.nn as nn
from . import EmbeddingFeedForward
from .. import util
from ..distributions import Categorical
class ProposalCategoricalCategorical(nn.Module):
def __init__(self, input_shape, num_categories, num_layers=2, hidden_dim=None)... | <filename>pyprob/nn/proposal_categorical_categorical.py
import torch
import torch.nn as nn
from . import EmbeddingFeedForward
from .. import util
from ..distributions import Categorical
class ProposalCategoricalCategorical(nn.Module):
def __init__(self, input_shape, num_categories, num_layers=2, hidden_dim=None)... | none | 1 | 2.67763 | 3 | |
Src/Clova/vendor/future/moves/configparser.py | NishiYusuke/Line-boot-award | 2 | 6622438 | from __future__ import absolute_import
from future.utils import PY2
if PY2:
from ConfigParser import *
else:
from configparser import *
| from __future__ import absolute_import
from future.utils import PY2
if PY2:
from ConfigParser import *
else:
from configparser import *
| none | 1 | 1.446979 | 1 | |
django/company/views.py | shortintern2020-A-labyrinth/TeamD | 4 | 6622439 | from rest_framework import generics, status, permissions
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from django import forms
import json, base64, io, os
import random
import string
import time
from .models import Company, Urls
from video.models impor... | from rest_framework import generics, status, permissions
from rest_framework.response import Response
from rest_framework.decorators import api_view, permission_classes
from django import forms
import json, base64, io, os
import random
import string
import time
from .models import Company, Urls
from video.models impor... | ja | 0.970901 | # 中原航大 # /api/company/ 時の処理 # GET: 投稿ビデオの取得 # POST: 動画投稿 # [{'name':'hoge', 'youtube_url':'hoge.com', ・・・},・・・] # 動画公開時の情報に対してバリデーション # 素材動画に対してバリデーション # リクエストパラメータの取得 #動画加工 #動画アップロード # 仮保存した動画を削除する # 公開した動画のURLをデータベースにいれる # バリデーション #動画加工 #編集後の動画返却 # コーデックをh264に設定した # file削除 # after-〇〇.mp4 削除 # try: # except: # ret... | 2.059417 | 2 |
main.py | tengfone/telegram_SUTDMountaineeringBanterBot | 0 | 6622440 | from telegram import ParseMode, ReplyKeyboardMarkup, ChatAction, InlineQueryResultArticle, InputTextMessageContent
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, InlineQueryHandler, CallbackQueryHandler, \
ConversationHandler, RegexHandler
import logging, os, sys, re
from functools i... | from telegram import ParseMode, ReplyKeyboardMarkup, ChatAction, InlineQueryResultArticle, InputTextMessageContent
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, InlineQueryHandler, CallbackQueryHandler, \
ConversationHandler, RegexHandler
import logging, os, sys, re
from functools i... | en | 0.402377 | # logger # global variable # options to run | 2.403751 | 2 |
scripts/make_triplets.py | atypon/S2AND | 39 | 6622441 | import argparse
import collections
import gzip
import json
import logging
import os
import tqdm
import numpy as np
import s2and
from s2and.data import ANDData
from s2and.consts import CONFIG
from s2and.text import counter_jaccard, cosine_sim, STOPWORDS
logger = logging.getLogger(__name__)
DATASETS = [
"aminer",... | import argparse
import collections
import gzip
import json
import logging
import os
import tqdm
import numpy as np
import s2and
from s2and.data import ANDData
from s2and.consts import CONFIG
from s2and.text import counter_jaccard, cosine_sim, STOPWORDS
logger = logging.getLogger(__name__)
DATASETS = [
"aminer",... | en | 0.61481 | # Need raw papers for output and ngram ranker | 2.46208 | 2 |
pytest_salt_formula/fixtures.py | martinwalsh/pytest-salt-formula | 2 | 6622442 | # -*- coding: utf-8 -*-
import os
import pytest
import salt.utils
import salt.config
import salt.client
from utils import abspath, touch
from contextlib import contextmanager
from salt.exceptions import SaltException
@pytest.fixture(scope='session')
def file_roots(request):
file_roots = request.config.getini('SA... | # -*- coding: utf-8 -*-
import os
import pytest
import salt.utils
import salt.config
import salt.client
from utils import abspath, touch
from contextlib import contextmanager
from salt.exceptions import SaltException
@pytest.fixture(scope='session')
def file_roots(request):
file_roots = request.config.getini('SA... | en | 0.607626 | # -*- coding: utf-8 -*- # an empty string forces download and cache of the rendered template # the `source` of `file.rename` is not a local file # remove the salt:// portion of the source url | 1.889253 | 2 |
Week4/Day3/Exc3.py | malharlakdawala/DevelopersInstitute | 0 | 6622443 | <reponame>malharlakdawala/DevelopersInstitute<gh_stars>0
# Exercise 1: List Of Integers - Randoms
# import random
#
# a=[]
# b=random.randint(1,50)
# while b!=0:
# a.append(random.randint(-100,100))
# b=b-1
#
# print(a)
#
# Exercise 2: Authentication CLI - Login:
a = {"malhar": "abc", "vinod": "charlie", "twink... | # Exercise 1: List Of Integers - Randoms
# import random
#
# a=[]
# b=random.randint(1,50)
# while b!=0:
# a.append(random.randint(-100,100))
# b=b-1
#
# print(a)
#
# Exercise 2: Authentication CLI - Login:
a = {"malhar": "abc", "vinod": "charlie", "twinkle": "rohan"}
while True:
first = input("do you want ... | en | 0.313946 | # Exercise 1: List Of Integers - Randoms # import random # # a=[] # b=random.randint(1,50) # while b!=0: # a.append(random.randint(-100,100)) # b=b-1 # # print(a) # # Exercise 2: Authentication CLI - Login: | 3.77005 | 4 |
src/listparser/opml.py | kurtmckee/listparser | 47 | 6622444 | # This file is part of listparser.
# Copyright 2009-2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: MIT
#
import copy
from . import common
from . import dates
class OpmlMixin(common.CommonMixin):
def start_opml_opml(self, attrs):
self.harvest['version'] = 'opml'
if attrs.get('version') in ('1.0... | # This file is part of listparser.
# Copyright 2009-2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: MIT
#
import copy
from . import common
from . import dates
class OpmlMixin(common.CommonMixin):
def start_opml_opml(self, attrs):
self.harvest['version'] = 'opml'
if attrs.get('version') in ('1.0... | en | 0.613006 | # This file is part of listparser. # Copyright 2009-2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: MIT # # Find an appropriate title in @text or @title (else empty) # Search for the URL regardless of xmlUrl's case # Determine whether the outline is a feed or subscription list # It's a feed # Actually, it's a subscrip... | 2.22426 | 2 |
src/bot.py | AWhiteFox/discord-mafia-bot | 1 | 6622445 | import asyncio
import os
import discord
from discord.ext import commands
import checks
import helpers
from game import Game
if os.path.isfile('../.env'):
from dotenv import load_dotenv
load_dotenv(encoding='utf8')
bot = commands.Bot(os.environ['PREFIX'])
game = None
game_state_lock = asyncio.Lock()
# Even... | import asyncio
import os
import discord
from discord.ext import commands
import checks
import helpers
from game import Game
if os.path.isfile('../.env'):
from dotenv import load_dotenv
load_dotenv(encoding='utf8')
bot = commands.Bot(os.environ['PREFIX'])
game = None
game_state_lock = asyncio.Lock()
# Even... | en | 0.856914 | # Events # If user joined current voice and game is running # If user left current voice # Global checks # Commands # Set prefixes # Remove prefixes # Commands for debugging | 2.288633 | 2 |
01-Native Baise com Python3/NativeBaise.py | sudo-ninguem/Analise-de-dados | 0 | 6622446 | ## Usando o Native Baise vamos fazer um programa que preveja a probabilidade de acidentes de veiculos
import pandas as pd ## Essa é a biblioteca que vamos usar para manipulação de dados
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.preprocessing import ... | ## Usando o Native Baise vamos fazer um programa que preveja a probabilidade de acidentes de veiculos
import pandas as pd ## Essa é a biblioteca que vamos usar para manipulação de dados
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.preprocessing import ... | pt | 0.932501 | ## Usando o Native Baise vamos fazer um programa que preveja a probabilidade de acidentes de veiculos ## Essa é a biblioteca que vamos usar para manipulação de dados ## Essa biblioteca permite fazermos a divisão entre os dados que serão utilizados para treino e para teste ## Essa biblioteca vai nos permitir visualizar ... | 2.828327 | 3 |
vnpy/app/cta_strategy/strategies/momentum_hunter_strategy.py | tonywanggit/vnpy | 11 | 6622447 | from vnpy.app.cta_strategy import (
CtaTemplate,
StopOrder,
TickData,
BarData,
TradeData,
OrderData,
BarGenerator,
ArrayManager,
)
class MomentumHunterStrategy(CtaTemplate):
""""""
author = "KEKE"
boll_window = 36
boll_dev = 2
atr_window = 30
atr_ma_window = 20... | from vnpy.app.cta_strategy import (
CtaTemplate,
StopOrder,
TickData,
BarData,
TradeData,
OrderData,
BarGenerator,
ArrayManager,
)
class MomentumHunterStrategy(CtaTemplate):
""""""
author = "KEKE"
boll_window = 36
boll_dev = 2
atr_window = 30
atr_ma_window = 20... | en | 0.637756 | Callback when strategy is inited. Callback when strategy is started. Callback when strategy is stopped. Callback of new tick data update. Callback of new bar data update. Callback of new order data update. Callback of new trade data update. Callback of stop order update. | 2.16334 | 2 |
ConformanceTests/TestPlugins/check_crd_status/check_crd_status.py | akashkeshari/arc-conformance-tests | 0 | 6622448 | <reponame>akashkeshari/arc-conformance-tests<gh_stars>0
import atexit
import os
import sys
from junit_xml import TestCase
from kubernetes import config, client
from results_utility import save_results, create_results_dir, append_result_output
from kubernetes_crd_utility import watch_crd_instance
# This directory con... | import atexit
import os
import sys
from junit_xml import TestCase
from kubernetes import config, client
from results_utility import save_results, create_results_dir, append_result_output
from kubernetes_crd_utility import watch_crd_instance
# This directory contains all result files corresponding to sonobuoy test ru... | en | 0.879817 | # This directory contains all result files corresponding to sonobuoy test run # Name of the tarfile containing all the result files # This file needs to be updated with the path to results file so that the sonobuoy worker understands that the test plugin container has completed its work. # This file is used to dump any... | 2.196256 | 2 |
RPG/classes.py | lmello0/rpg-estudo | 0 | 6622449 | class Classes:
def __init__(self, vNOME, vHP, vSP):
self.nome = vNOME
self.hp = vHP
self.sp = vSP
def getInfos(self):
print('----- ATRIBUTOS -----')
print('- NOME: {}'.format(self.nome))
print('- HP: {}'.format(self.hp))
print('- SP: {}'.format(self.s... | class Classes:
def __init__(self, vNOME, vHP, vSP):
self.nome = vNOME
self.hp = vHP
self.sp = vSP
def getInfos(self):
print('----- ATRIBUTOS -----')
print('- NOME: {}'.format(self.nome))
print('- HP: {}'.format(self.hp))
print('- SP: {}'.format(self.s... | none | 1 | 3.47036 | 3 | |
uninas/utils/system.py | cogsys-tuebingen/uninas | 18 | 6622450 | <reponame>cogsys-tuebingen/uninas<gh_stars>10-100
import os
import platform
import subprocess
import GPUtil
from pip._internal.operations.freeze import freeze
import torch.utils.collect_env as collect_env
import torch.backends.cudnn as cudnn
def headline(text: str) -> str:
return '\n\n\n' + '-'*100 + '\n' + text ... | import os
import platform
import subprocess
import GPUtil
from pip._internal.operations.freeze import freeze
import torch.utils.collect_env as collect_env
import torch.backends.cudnn as cudnn
def headline(text: str) -> str:
return '\n\n\n' + '-'*100 + '\n' + text + '\n' + '-'*100 + '\n'
def get_command_result(c... | en | 0.070887 | # o.write('\nnvidia-smi:\n%s\n' % get_command_result('nvidia-smi')) | 2.292146 | 2 |