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 |
|---|---|---|---|---|---|---|---|---|---|---|
mflops/model_info.py | shuncyu/mflops | 1 | 4800 | <reponame>shuncyu/mflops
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 17:38:48 2020
@author: luke
"""
import sys
from functools import partial
import torch
import torch.nn as nn
import prettytable as pt
from .basic_hook import MODULES_MAPPING
def get_model_compute_info(model, input_res,... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 17:38:48 2020
@author: luke
"""
import sys
from functools import partial
import torch
import torch.nn as nn
import prettytable as pt
from .basic_hook import MODULES_MAPPING
def get_model_compute_info(model, input_res,
... | en | 0.839945 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Mon Dec 14 17:38:48 2020 @author: luke # adding additional methods to the existing module object, # this is done this way so that each function has access to self object A method that will be available after add_computing_methods() is called on a desired ne... | 1.759832 | 2 |
dosagelib/plugins/derideal.py | Church-/dosage | 1 | 4801 | # SPDX-License-Identifier: MIT
# Copyright (C) 2019-2020 <NAME>
# Copyright (C) 2019-2020 <NAME>
from ..scraper import _ParserScraper
from ..helpers import indirectStarter
class Derideal(_ParserScraper):
baseUrl = 'https://www.derideal.com/'
imageSearch = '//img[contains(@class, "comic-page")]'
prevSearch... | # SPDX-License-Identifier: MIT
# Copyright (C) 2019-2020 <NAME>
# Copyright (C) 2019-2020 <NAME>
from ..scraper import _ParserScraper
from ..helpers import indirectStarter
class Derideal(_ParserScraper):
baseUrl = 'https://www.derideal.com/'
imageSearch = '//img[contains(@class, "comic-page")]'
prevSearch... | de | 0.299525 | # SPDX-License-Identifier: MIT # Copyright (C) 2019-2020 <NAME> # Copyright (C) 2019-2020 <NAME> | 2.572647 | 3 |
LearnFunction/learnfunction01.py | subash-kc/2022-01-04-Python | 1 | 4802 | <reponame>subash-kc/2022-01-04-Python
"""
Function are subprograms which are used to compute a value or perform a task.
Type of Functions:-
Built in Functions:
print(), upper()
User define functions
Advantage of Functions
1. Write once and use it as many time as you need. This provides code reusability
2. F... | """
Function are subprograms which are used to compute a value or perform a task.
Type of Functions:-
Built in Functions:
print(), upper()
User define functions
Advantage of Functions
1. Write once and use it as many time as you need. This provides code reusability
2. Function facilitates ease of code maint... | en | 0.806203 | Function are subprograms which are used to compute a value or perform a task. Type of Functions:- Built in Functions: print(), upper() User define functions Advantage of Functions 1. Write once and use it as many time as you need. This provides code reusability 2. Function facilitates ease of code maintenan... | 4.194516 | 4 |
trackr/cli.py | rpedigoni/trackr | 9 | 4803 | # coding: utf-8
import click
@click.command()
@click.option('--carrier', prompt='Carrier ID', help='Example: "ect" for Correios')
@click.option('--object-id', prompt='Object ID',
help='Example: PN871429404BR')
def main(carrier, object_id):
from trackr import Trackr
from trackr.exceptions import ... | # coding: utf-8
import click
@click.command()
@click.option('--carrier', prompt='Carrier ID', help='Example: "ect" for Correios')
@click.option('--object-id', prompt='Object ID',
help='Example: PN871429404BR')
def main(carrier, object_id):
from trackr import Trackr
from trackr.exceptions import ... | en | 0.833554 | # coding: utf-8 | 2.522514 | 3 |
pitop/common/notifications.py | pi-top/pi-top-Python-SDK | 28 | 4804 | <filename>pitop/common/notifications.py
from enum import Enum, auto
from subprocess import CalledProcessError, run
from pitop.common.command_runner import run_command
from pitop.common.logger import PTLogger
class NotificationAction:
def __init__(self, call_to_action_text, command_str) -> None:
self.call... | <filename>pitop/common/notifications.py
from enum import Enum, auto
from subprocess import CalledProcessError, run
from pitop.common.command_runner import run_command
from pitop.common.logger import PTLogger
class NotificationAction:
def __init__(self, call_to_action_text, command_str) -> None:
self.call... | en | 0.948041 | # Check that `notify-send-ng` is available, as it's not a hard dependency of the package | 2.30388 | 2 |
src/Gismo_XY To Location.py | AntonelloDN/gismo | 57 | 4805 | # xy to location
#
# Gismo is a plugin for GIS environmental analysis (GPL) started by <NAME>.
#
# This file is part of Gismo.
#
# Copyright (c) 2019, <NAME> <<EMAIL>>
# Gismo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Sof... | # xy to location
#
# Gismo is a plugin for GIS environmental analysis (GPL) started by <NAME>.
#
# This file is part of Gismo.
#
# Copyright (c) 2019, <NAME> <<EMAIL>>
# Gismo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Sof... | en | 0.827566 | # xy to location # # Gismo is a plugin for GIS environmental analysis (GPL) started by <NAME>. # # This file is part of Gismo. # # Copyright (c) 2019, <NAME> <<EMAIL>> # Gismo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software F... | 2.496145 | 2 |
Notebooks/SentinelUtilities/SentinelAnomalyLookup/__init__.py | ytognder/Azure-Sentinel | 266 | 4806 | # pylint: disable-msg=C0103
"""
SentinelAnomalyLookup: This package is developed for Azure Sentinel Anomaly lookup
"""
# __init__.py
from .anomaly_lookup_view_helper import AnomalyLookupViewHelper
from .anomaly_finder import AnomalyQueries, AnomalyFinder
| # pylint: disable-msg=C0103
"""
SentinelAnomalyLookup: This package is developed for Azure Sentinel Anomaly lookup
"""
# __init__.py
from .anomaly_lookup_view_helper import AnomalyLookupViewHelper
from .anomaly_finder import AnomalyQueries, AnomalyFinder
| en | 0.566672 | # pylint: disable-msg=C0103 SentinelAnomalyLookup: This package is developed for Azure Sentinel Anomaly lookup # __init__.py | 1.219606 | 1 |
items/coins.py | leerichoang/Legend-Of-Peach | 0 | 4807 | <reponame>leerichoang/Legend-Of-Peach<filename>items/coins.py
import pygame
from pygame.sprite import Sprite
class Coins(Sprite):
"""Coins"""
def __init__(self, hub, x, y, name='coin', state='floating'):
super().__init__()
# Values
self.name = name
self.hub = hub
self.o... | import pygame
from pygame.sprite import Sprite
class Coins(Sprite):
"""Coins"""
def __init__(self, hub, x, y, name='coin', state='floating'):
super().__init__()
# Values
self.name = name
self.hub = hub
self.original_pos = [x, y]
self.rest_height = y
se... | en | 0.499417 | Coins # Values # Screen Camera # Images Starts coin spin animation # start timer Starts coin rest animation # start timer | 3.346376 | 3 |
python/package/geo/test/__init__.py | fiomenankiti/playground | 0 | 4808 | from geo.calc import Calc
from geo.calc import Distance
from geo.geosp import Wt
from geo.geosp import Gh
from geo.files.csv_file import check | from geo.calc import Calc
from geo.calc import Distance
from geo.geosp import Wt
from geo.geosp import Gh
from geo.files.csv_file import check | none | 1 | 1.158155 | 1 | |
tests/test_clean.py | tcapelle/nb_helpers | 7 | 4809 | <gh_stars>1-10
from pathlib import Path
from nb_helpers.clean import clean_all, clean_one
from tests import TEST_PATH
TEST_PATH
TEST_NB = Path("test_nb.py")
def test_clean_one():
"clean just one nb"
clean_one(TEST_NB)
def test_clean_all():
"clean all test nbs"
clean_all(path=TEST_PATH)
| from pathlib import Path
from nb_helpers.clean import clean_all, clean_one
from tests import TEST_PATH
TEST_PATH
TEST_NB = Path("test_nb.py")
def test_clean_one():
"clean just one nb"
clean_one(TEST_NB)
def test_clean_all():
"clean all test nbs"
clean_all(path=TEST_PATH) | none | 1 | 2.216632 | 2 | |
apps/technical_analysis.py | KiloSat/FirstNivesh | 0 | 4810 | <filename>apps/technical_analysis.py
import streamlit as st
def app():
import yfinance as yf
import streamlit as st
import datetime
import matplotlib.pyplot as plt
import talib
import ta
import numpy as np
import matplotlib.ticker as mticker
import pandas as pd
import requests... | <filename>apps/technical_analysis.py
import streamlit as st
def app():
import yfinance as yf
import streamlit as st
import datetime
import matplotlib.pyplot as plt
import talib
import ta
import numpy as np
import matplotlib.ticker as mticker
import pandas as pd
import requests... | en | 0.555261 | # Technical Analysis of Securites Shown below are the **Moving Average Crossovers**, **Bollinger Bands**, **MACD's**, **Commodity Channel Indexes**, **Relative Strength Indexes** and **Extended Market Calculators** of any stock # Read data # Adjusted Close Price Adjusted Close Price\n {company_name} # ## SMA and EM... | 3.114378 | 3 |
tests/sentry/mediators/sentry_apps/test_creator.py | pombredanne/django-sentry | 0 | 4811 | <reponame>pombredanne/django-sentry
from __future__ import absolute_import
from mock import patch
from django.db import IntegrityError
from sentry.mediators.sentry_apps import Creator
from sentry.models import (
AuditLogEntry,
AuditLogEntryEvent,
ApiApplication,
IntegrationFeature,
SentryApp,
... | from __future__ import absolute_import
from mock import patch
from django.db import IntegrityError
from sentry.mediators.sentry_apps import Creator
from sentry.models import (
AuditLogEntry,
AuditLogEntryEvent,
ApiApplication,
IntegrationFeature,
SentryApp,
SentryAppComponent,
User,
)
from... | none | 1 | 2.067076 | 2 | |
python/Model_Files/LFV_3/parameters.py | ZAKI1905/HEP-Phen | 1 | 4812 | # This file was automatically created by FeynRules 2.3.32
# Mathematica version: 11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018)
# Date: Sat 21 Apr 2018 20:48:39
from object_library import all_parameters, Parameter
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
# This is a defau... | # This file was automatically created by FeynRules 2.3.32
# Mathematica version: 11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018)
# Date: Sat 21 Apr 2018 20:48:39
from object_library import all_parameters, Parameter
from function_library import complexconjugate, re, im, csc, sec, acsc, asec, cot
# This is a defau... | en | 0.805088 | # This file was automatically created by FeynRules 2.3.32 # Mathematica version: 11.3.0 for Mac OS X x86 (64-bit) (March 7, 2018) # Date: Sat 21 Apr 2018 20:48:39 # This is a default parameter object representing 0. # User-defined parameters. | 1.722154 | 2 |
musicLrc.py | xiangxing98/Rhythm-Enlightment | 0 | 4813 | <gh_stars>0
import time
musicLrc = """
[00:03.50]传奇
[00:19.10]作词:刘兵 作曲:李健
[00:20.60]演唱:王菲
[00:26.60]
[04:40.75][02:39.90][00:36.25]只是因为在人群中多看了你一眼
[04:49.00]
[02:47.44][00:43.69]再也没能忘掉你容颜
[02:54.83][00:51.24]梦想着偶然能有一天再相见
[03:02.32][00:58.75]从此我开始孤单思念
[03:08.15][01:04.30]
[03:09.35][01:05.50]想你时你在天边
[03:16.90][01:13.13]... | import time
musicLrc = """
[00:03.50]传奇
[00:19.10]作词:刘兵 作曲:李健
[00:20.60]演唱:王菲
[00:26.60]
[04:40.75][02:39.90][00:36.25]只是因为在人群中多看了你一眼
[04:49.00]
[02:47.44][00:43.69]再也没能忘掉你容颜
[02:54.83][00:51.24]梦想着偶然能有一天再相见
[03:02.32][00:58.75]从此我开始孤单思念
[03:08.15][01:04.30]
[03:09.35][01:05.50]想你时你在天边
[03:16.90][01:13.13]想你时你在眼前
[03:... | en | 0.298419 | [00:03.50]传奇 [00:19.10]作词:刘兵 作曲:李健 [00:20.60]演唱:王菲 [00:26.60] [04:40.75][02:39.90][00:36.25]只是因为在人群中多看了你一眼 [04:49.00] [02:47.44][00:43.69]再也没能忘掉你容颜 [02:54.83][00:51.24]梦想着偶然能有一天再相见 [03:02.32][00:58.75]从此我开始孤单思念 [03:08.15][01:04.30] [03:09.35][01:05.50]想你时你在天边 [03:16.90][01:13.13]想你时你在眼前 [03:24.42][01:20.92]想你时你在脑海 [03:... | 1.918993 | 2 |
octoprint_octopod/__init__.py | mnebelung/OctoPrint-OctoPod | 52 | 4814 | <reponame>mnebelung/OctoPrint-OctoPod
# coding=utf-8
from __future__ import absolute_import
import datetime
import logging
import sys
import flask
import octoprint.plugin
from octoprint.events import eventManager, Events
from octoprint.server import user_permission
from octoprint.util import RepeatedTimer
from .bed_... | # coding=utf-8
from __future__ import absolute_import
import datetime
import logging
import sys
import flask
import octoprint.plugin
from octoprint.events import eventManager, Events
from octoprint.server import user_permission
from octoprint.util import RepeatedTimer
from .bed_notifications import BedNotifications
... | en | 0.843879 | # coding=utf-8 # Plugin that stores APNS tokens reported from iOS devices to know which iOS devices to alert # when print is done or other relevant events # StartupPlugin mixin # Set logging level to what we have in the settings # Register to listen for messages from other plugins # Start timer that will check bed temp... | 1.809908 | 2 |
tests/test_buffers.py | romanchyla/CSPatterns | 0 | 4815 | from cspatterns.datastructures import buffer
def test_circular_buffer():
b = buffer.CircularBuffer(2, ['n'])
assert len(b.next) == 2
assert b.n is None
b = buffer.CircularBuffer.create(2, attrs=['n', 'fib'])
curr = b
out = [0, 1, ]
curr.prev[-2].n = 0
curr.prev[-2].fib = 1
curr... | from cspatterns.datastructures import buffer
def test_circular_buffer():
b = buffer.CircularBuffer(2, ['n'])
assert len(b.next) == 2
assert b.n is None
b = buffer.CircularBuffer.create(2, attrs=['n', 'fib'])
curr = b
out = [0, 1, ]
curr.prev[-2].n = 0
curr.prev[-2].fib = 1
curr... | en | 0.964706 | # we are going to calculate fibonacci | 3.058946 | 3 |
plugins/redacted/migrations/0001_initial.py | 2600box/harvest | 9 | 4816 | # Generated by Django 2.1.7 on 2019-02-17 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='RedactedClientConfig',
fields=[
('id', mode... | # Generated by Django 2.1.7 on 2019-02-17 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='RedactedClientConfig',
fields=[
('id', mode... | en | 0.733714 | # Generated by Django 2.1.7 on 2019-02-17 14:50 | 1.897892 | 2 |
code_examples/plotting_data/hexbin.py | ezcitron/BasemapTutorial | 99 | 4817 | from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from numpy import array
from numpy import max
map = Basemap(llcrnrlon=-0.5,llcrnrlat=39.8,urcrnrlon=4.,urcrnrlat=43.,
resolution='i', projection='tmerc', lat_0 = 39.5, lon_0 = 1)
map.readshapefil... | from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from numpy import array
from numpy import max
map = Basemap(llcrnrlon=-0.5,llcrnrlat=39.8,urcrnrlon=4.,urcrnrlat=43.,
resolution='i', projection='tmerc', lat_0 = 39.5, lon_0 = 1)
map.readshapefil... | es | 0.661242 | # lightnings)') | 2.147671 | 2 |
src/plugins/sjsy.py | 2443391447/nonebot2 | 1 | 4818 | <filename>src/plugins/sjsy.py
from nonebot import on_keyword, on_command
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Message, Bot, Event # 这两个没用的别删
from nonebot.adapters.cqhttp.message import MessageSegment
import requests
from nonebot.permission import *
from nonebot.rule import to_me... | <filename>src/plugins/sjsy.py
from nonebot import on_keyword, on_command
from nonebot.typing import T_State
from nonebot.adapters.cqhttp import Message, Bot, Event # 这两个没用的别删
from nonebot.adapters.cqhttp.message import MessageSegment
import requests
from nonebot.permission import *
from nonebot.rule import to_me... | zh | 0.550015 | # 这两个没用的别删 # await xians.send("正在爬取图片,请稍后……") # await xians.send(MessageSegment.at(id) + xians + "精选摄影") | 2.195756 | 2 |
src/extractors/emojiextractor.py | chmduquesne/rofimoji | 574 | 4819 | import html
from collections import namedtuple
from pathlib import Path
from typing import List, Dict
import requests
from bs4 import BeautifulSoup
from lxml import etree
from lxml.etree import XPath
Emoji = namedtuple('Emoji', 'char name')
class EmojiExtractor(object):
def __init__(self):
self.all_emo... | import html
from collections import namedtuple
from pathlib import Path
from typing import List, Dict
import requests
from bs4 import BeautifulSoup
from lxml import etree
from lxml.etree import XPath
Emoji = namedtuple('Emoji', 'char name')
class EmojiExtractor(object):
def __init__(self):
self.all_emo... | en | 0.508764 | # type: requests.Response # type: requests.Response # type: requests.Response | 2.880522 | 3 |
tests/integration_tests/security/test_seccomp.py | gregbdunn/firecracker | 2 | 4820 | <filename>tests/integration_tests/security/test_seccomp.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that the seccomp filters don't let blacklisted syscalls through."""
import os
from subprocess import run
import pytest
import host_tools... | <filename>tests/integration_tests/security/test_seccomp.py
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests that the seccomp filters don't let blacklisted syscalls through."""
import os
from subprocess import run
import pytest
import host_tools... | en | 0.810862 | # Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 Tests that the seccomp filters don't let blacklisted syscalls through. # pylint:disable=import-error Build `demo_basic_jailer`, required for the basic seccomp tests. :return: The paths of the built binar... | 2.001602 | 2 |
cluster/density/test.py | michealowen/MachingLearning | 2 | 4821 | <filename>cluster/density/test.py
class a:
def __init__(self,da):
self.da = da
return
def go(self):
dd()
return None
def dd():
print('ok')
return None
aa = a(1)
aa.go() | <filename>cluster/density/test.py
class a:
def __init__(self,da):
self.da = da
return
def go(self):
dd()
return None
def dd():
print('ok')
return None
aa = a(1)
aa.go() | none | 1 | 2.10675 | 2 | |
REM/Tool/IDA 7.3/python/ida_hexrays.py | dodieboy/Np_class | 0 | 4822 | <reponame>dodieboy/Np_class<gh_stars>0
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
IDA Plugin SDK API wrapper: hexrays
"""
from sys import version_info... | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
IDA Plugin SDK API wrapper: hexrays
"""
from sys import version_info
if version_info >= (2,6,0):
def sw... | en | 0.341361 | # This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. IDA Plugin SDK API wrapper: hexrays # Python < 2.2 doesn't have 'property'. _kludge_use_TPopupMenu(m) Proxy of C++ qv... | 1.771348 | 2 |
webapp/gen_graphs.py | bfitzy2142/NET4901-SP | 3 | 4823 | #!/usr/bin/env python3
"""
@author: <NAME>
MySql Parser for graphical presentation
"""
import mysql.connector
import datetime
from mysql.connector import Error
from datetime import datetime, timedelta
import json
class sql_graph_info():
def __init__(self, node, interface, time, sql_creds, db):
"""
... | #!/usr/bin/env python3
"""
@author: <NAME>
MySql Parser for graphical presentation
"""
import mysql.connector
import datetime
from mysql.connector import Error
from datetime import datetime, timedelta
import json
class sql_graph_info():
def __init__(self, node, interface, time, sql_creds, db):
"""
... | en | 0.760675 | #!/usr/bin/env python3 @author: <NAME> MySql Parser for graphical presentation Initializer for the sql_graph_info Object. Pulls the RX and TX information from the database to display for the graphs page. Arguments: node [str] -- The node that holds the interface which ... | 3.056756 | 3 |
scqubits/tests/test_fluxqubit.py | dmtvanzanten/scqubits | 0 | 4824 | # test_fluxqubit.py
# meant to be run with 'pytest'
#
# This file is part of scqubits.
#
# Copyright (c) 2019 and later, <NAME> and <NAME>
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
##############... | # test_fluxqubit.py
# meant to be run with 'pytest'
#
# This file is part of scqubits.
#
# Copyright (c) 2019 and later, <NAME> and <NAME>
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
##############... | en | 0.711229 | # test_fluxqubit.py # meant to be run with 'pytest' # # This file is part of scqubits. # # Copyright (c) 2019 and later, <NAME> and <NAME> # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. ##############... | 1.882443 | 2 |
PhysicsTools/PatAlgos/python/producersLayer1/pfParticleProducer_cfi.py | ckamtsikis/cmssw | 852 | 4825 | <filename>PhysicsTools/PatAlgos/python/producersLayer1/pfParticleProducer_cfi.py
import FWCore.ParameterSet.Config as cms
patPFParticles = cms.EDProducer("PATPFParticleProducer",
# General configurables
pfCandidateSource = cms.InputTag("noJet"),
# MC matching configurables
addGenMatch = cms.bool(False... | <filename>PhysicsTools/PatAlgos/python/producersLayer1/pfParticleProducer_cfi.py
import FWCore.ParameterSet.Config as cms
patPFParticles = cms.EDProducer("PATPFParticleProducer",
# General configurables
pfCandidateSource = cms.InputTag("noJet"),
# MC matching configurables
addGenMatch = cms.bool(False... | en | 0.531961 | # General configurables # MC matching configurables ## particles source to be used for the MC matching ## must be an InputTag or VInputTag to a product of ## type edm::Association<reco::GenParticleCollection> ## embed gen match inside the object instead of storing the ref # add user data # add custom classes here # add... | 1.921335 | 2 |
tests/test_api.py | ines/spacy-js | 141 | 4826 | <filename>tests/test_api.py
# coding: utf8
from __future__ import unicode_literals
import pytest
import spacy
import json
from api.server import parse, doc2json, load_model
@pytest.fixture(scope="session")
def model():
return "en_core_web_sm"
@pytest.fixture(scope="session")
def text():
return "This is a ... | <filename>tests/test_api.py
# coding: utf8
from __future__ import unicode_literals
import pytest
import spacy
import json
from api.server import parse, doc2json, load_model
@pytest.fixture(scope="session")
def model():
return "en_core_web_sm"
@pytest.fixture(scope="session")
def text():
return "This is a ... | en | 0.364999 | # coding: utf8 | 2.417835 | 2 |
python/GafferArnold/ArnoldTextureBake.py | medubelko/gaffer | 1 | 4827 | <reponame>medubelko/gaffer
##########################################################################
#
# Copyright (c) 2018, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
#... | ##########################################################################
#
# Copyright (c) 2018, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | en | 0.551188 | ########################################################################## # # Copyright (c) 2018, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib... | 0.923794 | 1 |
aea/protocols/generator/common.py | valory-xyz/agents-aea | 0 | 4828 | <filename>aea/protocols/generator/common.py
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file... | <filename>aea/protocols/generator/common.py
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file... | en | 0.686251 | # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ... | 1.69312 | 2 |
tests/unit/python/foglamp/services/core/api/test_backup_restore.py | vaibhav-ScaleDB/FogLAMP | 0 | 4829 | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import os
import asyncio
import json
from unittest.mock import MagicMock, patch
from collections import Counter
from aiohttp import web
import pytest
from foglamp.services.core import routes
from foglamp.services.core import ... | # -*- coding: utf-8 -*-
# FOGLAMP_BEGIN
# See: http://foglamp.readthedocs.io/
# FOGLAMP_END
import os
import asyncio
import json
from unittest.mock import MagicMock, patch
from collections import Counter
from aiohttp import web
import pytest
from foglamp.services.core import routes
from foglamp.services.core import ... | en | 0.506478 | # -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END Unit test the Backup functionality # fill the routes table Unit test the Restore functionality # fill the routes table | 1.969545 | 2 |
pyemits/core/preprocessing/dimensional_reduction.py | thompson0012/PyEmits | 6 | 4830 | <reponame>thompson0012/PyEmits<gh_stars>1-10
"""
Why need dimensional reduction
The following is the use of dimensionality reduction in the data set:
• As data dimensions continue to decrease, the space required for data storage will also decrease.
• Low-dimensional data helps reduce calculation/training time.
• Some ... | """
Why need dimensional reduction
The following is the use of dimensionality reduction in the data set:
• As data dimensions continue to decrease, the space required for data storage will also decrease.
• Low-dimensional data helps reduce calculation/training time.
• Some algorithms tend to perform poorly on high-dim... | en | 0.894996 | Why need dimensional reduction The following is the use of dimensionality reduction in the data set: • As data dimensions continue to decrease, the space required for data storage will also decrease. • Low-dimensional data helps reduce calculation/training time. • Some algorithms tend to perform poorly on high-dimensi... | 4.594706 | 5 |
sample_project/exam/exam.py | pcse/gitlab_tools | 0 | 4831 | <gh_stars>0
"""
These methods can be called inside WebCAT to determine which tests are loaded
for a given section/exam pair. This allows a common WebCAT submission site to
support different project tests
"""
def section():
# Instructor section (instructor to change before distribution)
#return 8527
#retur... | """
These methods can be called inside WebCAT to determine which tests are loaded
for a given section/exam pair. This allows a common WebCAT submission site to
support different project tests
"""
def section():
# Instructor section (instructor to change before distribution)
#return 8527
#return 8528
r... | en | 0.829382 | These methods can be called inside WebCAT to determine which tests are loaded for a given section/exam pair. This allows a common WebCAT submission site to support different project tests # Instructor section (instructor to change before distribution) #return 8527 #return 8528 # A or B exam (instructor to change to ma... | 2.228135 | 2 |
scrapy/clarinetear/spiders/pagina12.py | ramiror/clarinete | 0 | 4832 | <reponame>ramiror/clarinete<gh_stars>0
from datetime import datetime
import scrapy
import lxml
from lxml.html.clean import Cleaner
import re
SOURCE = 'Página 12'
LANGUAGE = 'es'
cleaner = Cleaner(allow_tags=['p', 'br', 'b', 'a', 'strong', 'i', 'em'])
class Pagina12Spider(scrapy.Spider):
name = 'pagina12'
allo... | from datetime import datetime
import scrapy
import lxml
from lxml.html.clean import Cleaner
import re
SOURCE = 'Página 12'
LANGUAGE = 'es'
cleaner = Cleaner(allow_tags=['p', 'br', 'b', 'a', 'strong', 'i', 'em'])
class Pagina12Spider(scrapy.Spider):
name = 'pagina12'
allowed_domains = ['www.pagina12.com.ar']
... | none | 1 | 2.830077 | 3 | |
svd.py | christyc14/fyp | 0 | 4833 | from calendar import c
from typing import Dict, List, Union
from zlib import DEF_BUF_SIZE
import json_lines
import numpy as np
import re
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.manifold import TSNE
from sklearn.preprocessing import StandardScaler
import pandas as pd
import json
from scipy.spa... | from calendar import c
from typing import Dict, List, Union
from zlib import DEF_BUF_SIZE
import json_lines
import numpy as np
import re
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.manifold import TSNE
from sklearn.preprocessing import StandardScaler
import pandas as pd
import json
from scipy.spa... | en | 0.893676 | # we want those that they haven't already tested # input data into List # to save myself if i do something dumb and run the scraper without deleting the .jsonlines file # option: category of product, eg cleanser # filter data by given option # of recs:") | 2.198459 | 2 |
esp32/tools/flasher.py | rodgergr/pycom-micropython-sigfox | 0 | 4834 | #!/usr/bin/env python
#
# Copyright (c) 2018, Pycom Limited.
#
# This software is licensed under the GNU GPL version 3 or any
# later version, with permitted additional terms. For more information
# see the Pycom Licence v1.0 document supplied with this file, or
# available at https://www.pycom.io/opensource/licensing
... | #!/usr/bin/env python
#
# Copyright (c) 2018, Pycom Limited.
#
# This software is licensed under the GNU GPL version 3 or any
# later version, with permitted additional terms. For more information
# see the Pycom Licence v1.0 document supplied with this file, or
# available at https://www.pycom.io/opensource/licensing
... | en | 0.811255 | #!/usr/bin/env python # # Copyright (c) 2018, Pycom Limited. # # This software is licensed under the GNU GPL version 3 or any # later version, with permitted additional terms. For more information # see the Pycom Licence v1.0 document supplied with this file, or # available at https://www.pycom.io/opensource/licensing ... | 2.43382 | 2 |
hknweb/events/tests/models/utils.py | jyxzhang/hknweb | 0 | 4835 | import datetime
from django.utils import timezone
from django.contrib.auth.models import User
from hknweb.events.models import Event, EventType, Rsvp
class ModelFactory:
@staticmethod
def create_user(**kwargs):
default_kwargs = {
"username": "default username",
}
kwargs =... | import datetime
from django.utils import timezone
from django.contrib.auth.models import User
from hknweb.events.models import Event, EventType, Rsvp
class ModelFactory:
@staticmethod
def create_user(**kwargs):
default_kwargs = {
"username": "default username",
}
kwargs =... | none | 1 | 2.344811 | 2 | |
HealthNet/prescriptions/views.py | jimga150/HealthNet | 0 | 4836 | <filename>HealthNet/prescriptions/views.py
from django.shortcuts import redirect
from .forms import PrescriptionForm
from core.views import is_doctor, is_nurse, is_admin, is_patient
from core.models import *
from .models import Prescription
from django.contrib.auth.decorators import login_required, user_passes_test... | <filename>HealthNet/prescriptions/views.py
from django.shortcuts import redirect
from .forms import PrescriptionForm
from core.views import is_doctor, is_nurse, is_admin, is_patient
from core.models import *
from .models import Prescription
from django.contrib.auth.decorators import login_required, user_passes_test... | en | 0.839782 | :param user: The User in question :return: True if the user is anything but an Admin :param user: The User in question :return: True if the user is a Doctor or Nurse Page for the form a doctor fills out to prescribe a drug :param request: the request with possible form submission :return: Prescription f... | 2.386135 | 2 |
algorithms/329. Longest Increasing Path in a Matrix.py | woozway/py3-leetcode | 1 | 4837 | """
1. Clarification
2. Possible solutions
- dfs + memoization
- Topological sort
3. Coding
4. Tests
"""
# T=O(m*n), S=O(m*n)
from functools import lru_cache
class Solution:
DIRS = [(-1, 0), (1, 0), (0, -1), (0, 1)]
def longestIncreasingPath(self, matrix: List[List[int]]) -> int:
if not mat... | """
1. Clarification
2. Possible solutions
- dfs + memoization
- Topological sort
3. Coding
4. Tests
"""
# T=O(m*n), S=O(m*n)
from functools import lru_cache
class Solution:
DIRS = [(-1, 0), (1, 0), (0, -1), (0, 1)]
def longestIncreasingPath(self, matrix: List[List[int]]) -> int:
if not mat... | en | 0.482289 | 1. Clarification 2. Possible solutions - dfs + memoization - Topological sort 3. Coding 4. Tests # T=O(m*n), S=O(m*n) # T=O(m*n), S=O(m*n) | 3.274547 | 3 |
cocos2d/tools/coding-style/tailing-spaces.py | NIKEA-SOFT/TestGame | 898 | 4838 | #!/usr/bin/env python
#coding=utf-8
'''
Remove tailing whitespaces and ensures one and only one empty ending line.
'''
import os, re
def scan(*dirs, **kwargs):
files = []
extensions = kwargs['extensions'] if kwargs.has_key('extensions') else None
excludes = kwargs['excludes'] if kwargs.has_key('excludes') else... | #!/usr/bin/env python
#coding=utf-8
'''
Remove tailing whitespaces and ensures one and only one empty ending line.
'''
import os, re
def scan(*dirs, **kwargs):
files = []
extensions = kwargs['extensions'] if kwargs.has_key('extensions') else None
excludes = kwargs['excludes'] if kwargs.has_key('excludes') else... | en | 0.501433 | #!/usr/bin/env python #coding=utf-8 Remove tailing whitespaces and ensures one and only one empty ending line. | 2.794257 | 3 |
three.py/TestPostprocessing-8Bit.py | Michael-Pascale/three.py | 0 | 4839 | from core import *
from cameras import *
from geometry import *
from material import *
from lights import *
class TestPostprocessing2(Base):
def initialize(self):
self.setWindowTitle('Pixellation and Reduced Color Palette')
self.setWindowSize(1024,768)
self.renderer = Rendere... | from core import *
from cameras import *
from geometry import *
from material import *
from lights import *
class TestPostprocessing2(Base):
def initialize(self):
self.setWindowTitle('Pixellation and Reduced Color Palette')
self.setWindowSize(1024,768)
self.renderer = Rendere... | en | 0.456292 | # add postprocessing content in vec2 vertexPosition; void main() { gl_Position = vec4(vertexPosition, 0, 1); } uniform sampler2D image; uniform vec2 textureSize; // round x to the nearest 1/denominator float roundFrac(float x, float denominator) ... | 2.231602 | 2 |
scripts/test_cache_size_vs_code_balance.py | tareqmalas/girih | 7 | 4840 | <filename>scripts/test_cache_size_vs_code_balance.py
#!/usr/bin/env python
def igs_test(target_dir, exp_name, th, group='', dry_run=0):
from scripts.conf.conf import machine_conf, machine_info
from scripts.utils import run_test
import itertools
cs = 8192
th = th
# Test using rasonable time
# T = scale... | <filename>scripts/test_cache_size_vs_code_balance.py
#!/usr/bin/env python
def igs_test(target_dir, exp_name, th, group='', dry_run=0):
from scripts.conf.conf import machine_conf, machine_info
from scripts.utils import run_test
import itertools
cs = 8192
th = th
# Test using rasonable time
# T = scale... | en | 0.548598 | #!/usr/bin/env python # Test using rasonable time # T = scale * size / perf # scale = T*perf/size #exp = is_dp, ts, k, N, bs_z, tb_l # spatial blocking # 1WD # Solar kernel # print outfile, ts, kernel, tb, N # user params # dry run | 1.736973 | 2 |
generate/lib/run-firefox/firefox_runner.py | flamencist/browser-extensions | 102 | 4841 | <reponame>flamencist/browser-extensions
import os
import shutil
import codecs
import json
from cuddlefish.runner import run_app
from cuddlefish.rdf import RDFManifest
def run():
original_harness_options = os.path.join('development', 'firefox', 'harness-options.json')
backup_harness_options = os.path.join('developme... | import os
import shutil
import codecs
import json
from cuddlefish.runner import run_app
from cuddlefish.rdf import RDFManifest
def run():
original_harness_options = os.path.join('development', 'firefox', 'harness-options.json')
backup_harness_options = os.path.join('development', 'firefox', 'harness-options-bak.jso... | none | 1 | 1.727308 | 2 | |
pyripple/protocol/orderbook.py | gip/pyripple | 0 | 4842 | # PyRipple
#
# Copyright 2015 <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 agreed to in wr... | # PyRipple
#
# Copyright 2015 <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 agreed to in wr... | en | 0.816962 | # PyRipple # # Copyright 2015 <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 agreed to in wr... | 2.239104 | 2 |
myvenv/lib/python3.6/site-packages/nltk/test/unit/test_senna.py | catb0y/twitter_feeling | 69 | 4843 | # -*- coding: utf-8 -*-
"""
Unit tests for Senna
"""
from __future__ import unicode_literals
from os import environ, path, sep
import logging
import unittest
from nltk.classify import Senna
from nltk.tag import SennaTagger, SennaChunkTagger, SennaNERTagger
# Set Senna executable path for tests if it is not specifie... | # -*- coding: utf-8 -*-
"""
Unit tests for Senna
"""
from __future__ import unicode_literals
from os import environ, path, sep
import logging
import unittest
from nltk.classify import Senna
from nltk.tag import SennaTagger, SennaChunkTagger, SennaNERTagger
# Set Senna executable path for tests if it is not specifie... | en | 0.644684 | # -*- coding: utf-8 -*- Unit tests for Senna # Set Senna executable path for tests if it is not specified as an environment variable Unittest for nltk.classify.senna Senna pipeline interface Unittest for nltk.tag.senna | 2.594379 | 3 |
eoxserver/services/opensearch/v11/description.py | kalxas/eoxserver | 25 | 4844 | #-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: <NAME> <<EMAIL>>
#
#-------------------------------------------------------------------------------
# Copyright (C) 2015 EOX IT Services GmbH
#
# Permission is hereby granted, free o... | #-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: <NAME> <<EMAIL>>
#
#-------------------------------------------------------------------------------
# Copyright (C) 2015 EOX IT Services GmbH
#
# Permission is hereby granted, free o... | en | 0.641775 | #------------------------------------------------------------------------------- # # Project: EOxServer <http://eoxserver.org> # Authors: <NAME> <<EMAIL>> # #------------------------------------------------------------------------------- # Copyright (C) 2015 EOX IT Services GmbH # # Permission is hereby granted, free o... | 1.318776 | 1 |
exercises/level_0/stringing.py | eliranM98/python_course | 6 | 4845 | <reponame>eliranM98/python_course
text = '''
<NAME>'s ({}) tale of injustice, heroism and love follows the fortunes of <NAME>, an escaped convict determined to put his criminal past behind him. But his attempts to become a respected member of the community are constantly put under threat: by his own conscience, when, o... | text = '''
<NAME>'s ({}) tale of injustice, heroism and love follows the fortunes of <NAME>, an escaped convict determined to put his criminal past behind him. But his attempts to become a respected member of the community are constantly put under threat: by his own conscience, when, owing to a case of mistaken identit... | en | 0.972106 | <NAME>'s ({}) tale of injustice, heroism and love follows the fortunes of <NAME>, an escaped convict determined to put his criminal past behind him. But his attempts to become a respected member of the community are constantly put under threat: by his own conscience, when, owing to a case of mistaken identity, another ... | 3.393625 | 3 |
lab1/text_recognizer/models/mlp.py | Agyey/fsdl-text-recognizer-2021-labs | 0 | 4846 | <gh_stars>0
from typing import Any, Dict
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
FC1_DIM = 1024
FC2_DIM = 128
class MLP(nn.Module):
"""Simple MLP suitable for recognizing single characters."""
def __init__(
self,
data_config: Dic... | from typing import Any, Dict
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
FC1_DIM = 1024
FC2_DIM = 128
class MLP(nn.Module):
"""Simple MLP suitable for recognizing single characters."""
def __init__(
self,
data_config: Dict[str, Any],... | en | 0.908314 | Simple MLP suitable for recognizing single characters. | 2.911827 | 3 |
frontend/widgets/button.py | AzoeDesarrollos/PyMavisDatabase | 0 | 4847 | from pygame import Surface, font
from .basewidget import BaseWidget
from frontend import Renderer, WidgetHandler
class Button(BaseWidget):
action = None
def __init__(self, x, y, texto, action=None):
self.f = font.SysFont('Verdana', 16)
imagen = self.crear(texto)
rect = imagen.get_rect... | from pygame import Surface, font
from .basewidget import BaseWidget
from frontend import Renderer, WidgetHandler
class Button(BaseWidget):
action = None
def __init__(self, x, y, texto, action=None):
self.f = font.SysFont('Verdana', 16)
imagen = self.crear(texto)
rect = imagen.get_rect... | none | 1 | 2.921443 | 3 | |
tensorflow_rnn/mnist_lstm.py | naoki009/samples | 0 | 4848 | <filename>tensorflow_rnn/mnist_lstm.py<gh_stars>0
import numpy as np
import tensorflow as tf
"""
Do an MNIST classification line by line by LSTM
"""
(x_train, y_train), \
(x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train, x_test = x_train/255.0, x_test/255.0
model = tf.keras.Sequential()
model.add(t... | <filename>tensorflow_rnn/mnist_lstm.py<gh_stars>0
import numpy as np
import tensorflow as tf
"""
Do an MNIST classification line by line by LSTM
"""
(x_train, y_train), \
(x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train, x_test = x_train/255.0, x_test/255.0
model = tf.keras.Sequential()
model.add(t... | en | 0.727221 | Do an MNIST classification line by line by LSTM #model.add(tf.keras.layers.BatchNormalization()) | 3.004097 | 3 |
scrap/CloudCoverUndersampling.py | cseale/kaggle-amazon-rainforests | 0 | 4849 | <filename>scrap/CloudCoverUndersampling.py<gh_stars>0
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import os
from random import shuffle
from tqdm import tqdm
DATA_DIR = '../input/amazon/'
TRAIN_TIF_DIR = DATA_DIR + 'train-tif/'
TRAIN_CSV = DATA_DIR + 'train.csv'
TEST_TIF_DIR = DATA_DIR + 'test-ti... | <filename>scrap/CloudCoverUndersampling.py<gh_stars>0
# coding: utf-8
# In[1]:
import numpy as np
import pandas as pd
import os
from random import shuffle
from tqdm import tqdm
DATA_DIR = '../input/amazon/'
TRAIN_TIF_DIR = DATA_DIR + 'train-tif/'
TRAIN_CSV = DATA_DIR + 'train.csv'
TEST_TIF_DIR = DATA_DIR + 'test-ti... | en | 0.928926 | # coding: utf-8 # In[1]: # read our data and take a look at what we are dealing with # In[17]: | 2.552236 | 3 |
rpython/translator/platform/posix.py | wdv4758h/mu-client-pypy | 0 | 4850 | """Base support for POSIX-like platforms."""
import py, os, sys
from rpython.translator.platform import Platform, log, _run_subprocess
import rpython
rpydir = str(py.path.local(rpython.__file__).join('..'))
class BasePosix(Platform):
exe_ext = ''
make_cmd = 'make'
relevant_environ = ('CPATH', 'LIBRARY_... | """Base support for POSIX-like platforms."""
import py, os, sys
from rpython.translator.platform import Platform, log, _run_subprocess
import rpython
rpydir = str(py.path.local(rpython.__file__).join('..'))
class BasePosix(Platform):
exe_ext = ''
make_cmd = 'make'
relevant_environ = ('CPATH', 'LIBRARY_... | en | 0.877301 | Base support for POSIX-like platforms. # strip compiler flags # # if pkg-config explicitly returned nothing, then # we assume it means no options are needed # check that at least one of the results is a valid dir # needed for cross-compilation i.e. ARM # Hack: also relativize from the path '$RPYDIR/..'. # Otherwise, wh... | 2.127603 | 2 |
chintai-scrape/A001_parse_htmls.py | GINK03/itmedia-scraping | 16 | 4851 | import glob
import bs4
import gzip
import pickle
import re
import os
from concurrent.futures import ProcessPoolExecutor as PPE
import json
from pathlib import Path
from hashlib import sha256
import shutil
Path('json').mkdir(exist_ok=True)
def sanitize(text):
text = re.sub(r'(\t|\n|\r)', '', text)
text = re.s... | import glob
import bs4
import gzip
import pickle
import re
import os
from concurrent.futures import ProcessPoolExecutor as PPE
import json
from pathlib import Path
from hashlib import sha256
import shutil
Path('json').mkdir(exist_ok=True)
def sanitize(text):
text = re.sub(r'(\t|\n|\r)', '', text)
text = re.s... | en | 0.180134 | # ズレの処理 #print(tds.pop(0).text) #print(table) #Path(fn).unlink() #detail_table = soup.find('table', {'class':'bukken_detail_table'}) #detail_obj = {re.sub(r'\t', '', th.text):re.sub(r'(\t|\n)', '', td.text) for th, td in zip(detail_table.find_all('th'), detail_table.find_all('td'))} #print(detail_obj) #urls = [sha256(b... | 2.390279 | 2 |
google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/scrape/metadata_scraper.py | ricardolsmendes/datacatalog-connectors-hive | 19 | 4852 | <filename>google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/scrape/metadata_scraper.py
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | <filename>google-datacatalog-apache-atlas-connector/src/google/datacatalog_connectors/apache_atlas/scrape/metadata_scraper.py
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | en | 0.8466 | #!/usr/bin/python # # Copyright 2020 Google LLC # # 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 ag... | 1.922909 | 2 |
aviary/roost/data.py | sxie22/aviary | 0 | 4853 | import functools
import json
from os.path import abspath, dirname, exists, join
from typing import Dict, Sequence
import numpy as np
import pandas as pd
import torch
from pymatgen.core import Composition
from torch.utils.data import Dataset
class CompositionData(Dataset):
def __init__(
self,
df: ... | import functools
import json
from os.path import abspath, dirname, exists, join
from typing import Dict, Sequence
import numpy as np
import pandas as pd
import torch
from pymatgen.core import Composition
from torch.utils.data import Dataset
class CompositionData(Dataset):
def __init__(
self,
df: ... | en | 0.634545 | Data class for Roost models. Args: df (pd.DataFrame): Pandas dataframe holding input and target values. task_dict (dict[str, "regression" | "classification"]): Map from target names to task type. elem_emb (str, optional): One of "matscholar200", "cgcnn92", "m... | 2.676687 | 3 |
tests/test_util.py | danqing/dqpy | 0 | 4854 | import unittest
from dq import util
class TestUtil(unittest.TestCase):
def test_safe_cast(self):
assert util.safe_cast('1', int) == 1
assert util.safe_cast('meow', int, 2) == 2
| import unittest
from dq import util
class TestUtil(unittest.TestCase):
def test_safe_cast(self):
assert util.safe_cast('1', int) == 1
assert util.safe_cast('meow', int, 2) == 2
| none | 1 | 3.030552 | 3 | |
check_perm.py | codecakes/random_games | 0 | 4855 | <reponame>codecakes/random_games
"""
PermCheck
Check whether array A is a permutation.
https://codility.com/demo/results/demoANZ7M2-GFU/
Task description
A non-empty zero-indexed array A consisting of N integers is given.
A permutation is a sequence containing each element from 1 to N once, and only once.
For example... | """
PermCheck
Check whether array A is a permutation.
https://codility.com/demo/results/demoANZ7M2-GFU/
Task description
A non-empty zero-indexed array A consisting of N integers is given.
A permutation is a sequence containing each element from 1 to N once, and only once.
For example, array A such that:
A[0] = 4... | en | 0.810888 | PermCheck Check whether array A is a permutation. https://codility.com/demo/results/demoANZ7M2-GFU/ Task description A non-empty zero-indexed array A consisting of N integers is given. A permutation is a sequence containing each element from 1 to N once, and only once. For example, array A such that: A[0] = 4 ... | 3.770444 | 4 |
src/oci/log_analytics/models/log_analytics_association.py | Manny27nyc/oci-python-sdk | 249 | 4856 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | en | 0.695205 | # coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 2.098531 | 2 |
symblic_game/NEW_GAME.py | zishanqin/Symbolic-transfer | 3 | 4857 | <reponame>zishanqin/Symbolic-transfer
'Author: <NAME>'
'''email: <EMAIL>'''
# -------------------------------------------------------------------------------------------------- #
# This code can run 4 different models of Reinforcement Learning:
# Q-Learning (QL), DQN, SRL (DSRL), SRL+CS(DSRL_object_near) and some o... | 'Author: <NAME>'
'''email: <EMAIL>'''
# -------------------------------------------------------------------------------------------------- #
# This code can run 4 different models of Reinforcement Learning:
# Q-Learning (QL), DQN, SRL (DSRL), SRL+CS(DSRL_object_near) and some other variations of SRL
# The setting ... | en | 0.589911 | email: <EMAIL> # -------------------------------------------------------------------------------------------------- # # This code can run 4 different models of Reinforcement Learning: # Q-Learning (QL), DQN, SRL (DSRL), SRL+CS(DSRL_object_near) and some other variations of SRL # The setting for each run can be set at t... | 2.181023 | 2 |
utils/scene_bounding_box.py | davidemarelli/sfm_flow | 8 | 4858 |
import logging
from typing import Tuple
import bpy
from mathutils import Vector
from .object import get_objs
logger = logging.getLogger(__name__)
class SceneBoundingBox():
"""Scene bounding box, build a bounding box that includes all objects except the excluded ones."""
##################################... |
import logging
from typing import Tuple
import bpy
from mathutils import Vector
from .object import get_objs
logger = logging.getLogger(__name__)
class SceneBoundingBox():
"""Scene bounding box, build a bounding box that includes all objects except the excluded ones."""
##################################... | en | 0.326248 | Scene bounding box, build a bounding box that includes all objects except the excluded ones. ################################################################################################ # Properties # # ============================================================================================== Scene's bounding b... | 2.918548 | 3 |
tensor2tensor/trax/rlax/ppo.py | funtion/tensor2tensor | 1 | 4859 | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# 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... | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# 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... | en | 0.841795 | # coding=utf-8 # Copyright 2019 The Tensor2Tensor Authors. # # 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... | 2.181834 | 2 |
models/cal.py | SudoRmFr/The-Nature-Conservancy-Fisheries-Monitoring | 0 | 4860 | <reponame>SudoRmFr/The-Nature-Conservancy-Fisheries-Monitoring
"""
WS-DAN models
<NAME> al.,
"See Better Before Looking Closer: Weakly Supervised Data Augmentation Network for Fine-Grained Visual Classification",
arXiv:1901.09891
"""
import logging
import numpy as np
import torch
import torch.nn as nn
import torch.nn.f... | """
WS-DAN models
<NAME> al.,
"See Better Before Looking Closer: Weakly Supervised Data Augmentation Network for Fine-Grained Visual Classification",
arXiv:1901.09891
"""
import logging
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import models.resnet as resnet
from models.ince... | en | 0.678633 | WS-DAN models <NAME> al., "See Better Before Looking Closer: Weakly Supervised Data Augmentation Network for Fine-Grained Visual Classification", arXiv:1901.09891 # Bilinear Attention Pooling # match size # feature_matrix: (B, M, C) -> (B, M * C) # sign-sqrt # l2 normalization along dimension M and C # Network Initiali... | 2.385153 | 2 |
tests/walls/analytic/plates.py | noabauma/Mirheo | 0 | 4861 | #!/usr/bin/env python
import mirheo as mir
dt = 0.001
ranks = (1, 1, 1)
domain = (8, 16, 8)
force = (1.0, 0, 0)
density = 4
u = mir.Mirheo(ranks, domain, dt, debug_level=3, log_filename='log', no_splash=True)
pv = mir.ParticleVectors.ParticleVector('pv', mass = 1)
ic = mir.InitialConditions.Uniform(number_densit... | #!/usr/bin/env python
import mirheo as mir
dt = 0.001
ranks = (1, 1, 1)
domain = (8, 16, 8)
force = (1.0, 0, 0)
density = 4
u = mir.Mirheo(ranks, domain, dt, debug_level=3, log_filename='log', no_splash=True)
pv = mir.ParticleVectors.ParticleVector('pv', mass = 1)
ic = mir.InitialConditions.Uniform(number_densit... | en | 0.242554 | #!/usr/bin/env python # nTEST: walls.analytic.plates # cd walls/analytic # rm -rf h5 # mir.run --runargs "-n 2" ./plates.py # mir.avgh5 xy velocities h5/solvent-0000[4-7].h5 | awk '{print $1}' > profile.out.txt | 1.924984 | 2 |
scraper-code/myanimelist/base.py | XueAlfred/MALAnalysis | 15 | 4862 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import abc
import bs4
import functools
import utilities
class Error(Exception):
"""Base exception class that takes a message to display upon raising.
"""
def __init__(self, message=None):
"""Creates an instance of Error.
:type message: str
:param message: A... | #!/usr/bin/python
# -*- coding: utf-8 -*-
import abc
import bs4
import functools
import utilities
class Error(Exception):
"""Base exception class that takes a message to display upon raising.
"""
def __init__(self, message=None):
"""Creates an instance of Error.
:type message: str
:param message: A... | en | 0.766142 | #!/usr/bin/python # -*- coding: utf-8 -*- Base exception class that takes a message to display upon raising. Creates an instance of Error. :type message: str :param message: A message to display when raising the exception. Indicates that a page on MAL has broken markup in some way. Indicates that the particula... | 3.2446 | 3 |
p2/core/http.py | BeryJu/p2 | 0 | 4863 | """p2 core http responses"""
from wsgiref.util import FileWrapper
from django.http import StreamingHttpResponse
from p2.core.constants import ATTR_BLOB_MIME, ATTR_BLOB_SIZE_BYTES
from p2.core.models import Blob
class BlobResponse(StreamingHttpResponse):
"""Directly return blob's content. Optionally return as at... | """p2 core http responses"""
from wsgiref.util import FileWrapper
from django.http import StreamingHttpResponse
from p2.core.constants import ATTR_BLOB_MIME, ATTR_BLOB_SIZE_BYTES
from p2.core.models import Blob
class BlobResponse(StreamingHttpResponse):
"""Directly return blob's content. Optionally return as at... | en | 0.780244 | p2 core http responses Directly return blob's content. Optionally return as attachment if as_download is True | 2.744616 | 3 |
lattedb/project/formfac/migrations/0009_auto_20200528_0907.py | callat-qcd/lattedb | 1 | 4864 | <filename>lattedb/project/formfac/migrations/0009_auto_20200528_0907.py
# Generated by Django 3.0.6 on 2020-05-28 09:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_... | <filename>lattedb/project/formfac/migrations/0009_auto_20200528_0907.py
# Generated by Django 3.0.6 on 2020-05-28 09:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_... | en | 0.783072 | # Generated by Django 3.0.6 on 2020-05-28 09:07 | 1.58096 | 2 |
SIO_Code/SIO_coherence.py | mmstoll/Ocean569_Code | 0 | 4865 | """
Data: Temperature and Salinity time series from SIO Scripps Pier
Salinity: measured in PSU at the surface (~0.5m) and at depth (~5m)
Temp: measured in degrees C at the surface (~0.5m) and at depth (~5m)
- Timestamp included beginning in 1990
"""
# imports
import sys,os
import pandas as pd
import numpy as... | """
Data: Temperature and Salinity time series from SIO Scripps Pier
Salinity: measured in PSU at the surface (~0.5m) and at depth (~5m)
Temp: measured in degrees C at the surface (~0.5m) and at depth (~5m)
- Timestamp included beginning in 1990
"""
# imports
import sys,os
import pandas as pd
import numpy as... | en | 0.66742 | Data: Temperature and Salinity time series from SIO Scripps Pier Salinity: measured in PSU at the surface (~0.5m) and at depth (~5m) Temp: measured in degrees C at the surface (~0.5m) and at depth (~5m) - Timestamp included beginning in 1990 # imports # read in temp and sal files # convert year, month, day colu... | 2.513876 | 3 |
abfs/group_data_split.py | rcdilorenzo/abfs | 7 | 4866 | <gh_stars>1-10
from collections import namedtuple as Struct
from sklearn.model_selection import GroupShuffleSplit, ShuffleSplit
DataSplitConfig = Struct('DataSplitConfig', ['validation_size', 'test_size', 'random_seed'])
DEFAULT_SPLIT_CONFIG = DataSplitConfig(0.2, 0.2, 1337)
class GroupDataSplit():
def __init__(... | from collections import namedtuple as Struct
from sklearn.model_selection import GroupShuffleSplit, ShuffleSplit
DataSplitConfig = Struct('DataSplitConfig', ['validation_size', 'test_size', 'random_seed'])
DEFAULT_SPLIT_CONFIG = DataSplitConfig(0.2, 0.2, 1337)
class GroupDataSplit():
def __init__(self, df, key, ... | en | 0.469201 | Total records in the data frame Randomized train data frame Validation data frame Test data frame | 3.066598 | 3 |
mmcls/models/utils/se_layer.py | YuxinZou/mmclassification | 1,190 | 4867 | <gh_stars>1000+
# Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from .make_divisible import make_divisible
class SELayer(BaseModule):
"""Squeeze-and-Excitation Module.
Args:
channels (int): The input... | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.runner import BaseModule
from .make_divisible import make_divisible
class SELayer(BaseModule):
"""Squeeze-and-Excitation Module.
Args:
channels (int): The input (and output) ch... | en | 0.730234 | # Copyright (c) OpenMMLab. All rights reserved. Squeeze-and-Excitation Module. Args: channels (int): The input (and output) channels of the SE layer. squeeze_channels (None or int): The intermediate channel number of SElayer. Default: None, means the value of ``squeeze_channels`` ... | 2.987258 | 3 |
instagram/admin.py | James19stack/instagram-copy_cat | 0 | 4868 | <reponame>James19stack/instagram-copy_cat<filename>instagram/admin.py
from django.contrib import admin
from .models import Images,Comments,Profile
# Register your models here.
class CommentInline(admin.TabularInline):
model=Comments
extra=3
class ImageInline(admin.ModelAdmin):
fieldsets=[
(Non... | from django.contrib import admin
from .models import Images,Comments,Profile
# Register your models here.
class CommentInline(admin.TabularInline):
model=Comments
extra=3
class ImageInline(admin.ModelAdmin):
fieldsets=[
(None,{'fields':['image']}),
(None,{'fields':['image_name']}),
... | en | 0.968259 | # Register your models here. | 1.827312 | 2 |
mandelbruh/util.py | pereradrian/mandelbruh | 0 | 4869 | import numpy as np
def normalize(x):
return x / np.linalg.norm(x)
def norm_sq(v):
return np.dot(v,v)
def norm(v):
return np.linalg.norm(v)
def get_sub_keys(v):
if type(v) is not tuple and type(v) is not list:
return []
return [k for k in v if type(k) is str]
def to_vec3(v):
if isinstance(v, (float, int)):
... | import numpy as np
def normalize(x):
return x / np.linalg.norm(x)
def norm_sq(v):
return np.dot(v,v)
def norm(v):
return np.linalg.norm(v)
def get_sub_keys(v):
if type(v) is not tuple and type(v) is not list:
return []
return [k for k in v if type(k) is str]
def to_vec3(v):
if isinstance(v, (float, int)):
... | none | 1 | 2.836679 | 3 | |
core/recognizer.py | awen1988/yry | 129 | 4870 | """
recognize face landmark
"""
import json
import os
import requests
import numpy as np
FACE_POINTS = list(range(0, 83))
JAW_POINTS = list(range(0, 19))
LEFT_EYE_POINTS = list(range(19, 29))
LEFT_BROW_POINTS = list(range(29, 37))
MOUTH_POINTS = list(range(37, 55))
NOSE_POINTS = list(range(55, 65))
RIGHT_EYE_POINTS =... | """
recognize face landmark
"""
import json
import os
import requests
import numpy as np
FACE_POINTS = list(range(0, 83))
JAW_POINTS = list(range(0, 19))
LEFT_EYE_POINTS = list(range(19, 29))
LEFT_BROW_POINTS = list(range(29, 37))
MOUTH_POINTS = list(range(37, 55))
NOSE_POINTS = list(range(55, 65))
RIGHT_EYE_POINTS =... | en | 0.672471 | recognize face landmark | 3.122251 | 3 |
magvar.py | rafidmorshedi/mag-dec-api | 0 | 4871 | import requests
import time
from bs4 import BeautifulSoup
import re
def decdeg2dms(dd):
negative = dd < 0
dd = abs(dd)
minutes,seconds = divmod(dd*3600,60)
degrees,minutes = divmod(minutes,60)
if negative:
if degrees > 0:
degrees = -degrees
elif minutes > 0:
... | import requests
import time
from bs4 import BeautifulSoup
import re
def decdeg2dms(dd):
negative = dd < 0
dd = abs(dd)
minutes,seconds = divmod(dd*3600,60)
degrees,minutes = divmod(minutes,60)
if negative:
if degrees > 0:
degrees = -degrees
elif minutes > 0:
... | en | 0.277099 | Returns the magnetic variation at a particulat point on earth. Keyword Arguments lat -- latitude (e.g. -180.6 deg) lon -- longitude (e.g. -34.6 deg) elev -- elevation in km (default 0.0) year -- year (e.g. 2015) month -- month (e.g. 11) day -- day (e.g. 30) Returns float -- magneti... | 3.207296 | 3 |
google-cloud-sdk/lib/googlecloudsdk/third_party/apis/datacatalog/v1beta1/datacatalog_v1beta1_messages.py | bopopescu/Social-Lite | 0 | 4872 | <filename>google-cloud-sdk/lib/googlecloudsdk/third_party/apis/datacatalog/v1beta1/datacatalog_v1beta1_messages.py
"""Generated message classes for datacatalog version v1beta1.
A fully managed and highly scalable data discovery and metadata management
service.
"""
# NOTE: This file is autogenerated and should not be e... | <filename>google-cloud-sdk/lib/googlecloudsdk/third_party/apis/datacatalog/v1beta1/datacatalog_v1beta1_messages.py
"""Generated message classes for datacatalog version v1beta1.
A fully managed and highly scalable data discovery and metadata management
service.
"""
# NOTE: This file is autogenerated and should not be e... | en | 0.706252 | Generated message classes for datacatalog version v1beta1. A fully managed and highly scalable data discovery and metadata management service. # NOTE: This file is autogenerated and should not be edited by hand. Associates `members` with a `role`. Fields: condition: The condition that is associated with this bi... | 1.732691 | 2 |
materials/migrations/0072_auto_20190422_1708.py | mgovoni-devel/MatD3 | 7 | 4873 | <reponame>mgovoni-devel/MatD3
# Generated by Django 2.1.7 on 2019-04-22 21:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('materials', '0071_auto_20190416_1557'),
]
operations = [
migrations.RemoveField(
model_name='atomicpositio... | # Generated by Django 2.1.7 on 2019-04-22 21:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('materials', '0071_auto_20190416_1557'),
]
operations = [
migrations.RemoveField(
model_name='atomicpositions',
name='idinfo_... | en | 0.568828 | # Generated by Django 2.1.7 on 2019-04-22 21:08 | 1.461022 | 1 |
Deep-Learning/Crowd-Count/src/data_preprocess.py | sadbb/CVCode | 1 | 4874 | # -*- coding:utf-8 -*-
# ------------------------
# written by <NAME>
# 2018-10
# ------------------------
import os
import skimage.io
from skimage.color import rgb2gray
import skimage.transform
from scipy.io import loadmat
import numpy as np
import cv2
import math
import warnings
import random
import torch
import mat... | # -*- coding:utf-8 -*-
# ------------------------
# written by <NAME>
# 2018-10
# ------------------------
import os
import skimage.io
from skimage.color import rgb2gray
import skimage.transform
from scipy.io import loadmat
import numpy as np
import cv2
import math
import warnings
import random
import torch
import mat... | en | 0.713874 | # -*- coding:utf-8 -*- # ------------------------ # written by <NAME> # 2018-10 # ------------------------ # convert x, y to int # generate 2d gaussian kernel # original path # preprocessed path # convert images to gray-density for each # convert to gray map # gaussian transfer # split image into 9 patches where patch ... | 2.380466 | 2 |
for1.py | satyamraj123/set-of-python-programs | 0 | 4875 | fruit='banana'
x=len(fruit)
print(x) | fruit='banana'
x=len(fruit)
print(x) | none | 1 | 2.724912 | 3 | |
Django_Intershala/recruiter/migrations/0004_auto_20210305_1551.py | samir321-pixel/Django_Intershala | 7 | 4876 | <reponame>samir321-pixel/Django_Intershala
# Generated by Django 3.1.7 on 2021-03-05 10:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recruiter', '0003_auto_20210304_2132'),
]
operations = [
migrations.RemoveField(
mode... | # Generated by Django 3.1.7 on 2021-03-05 10:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recruiter', '0003_auto_20210304_2132'),
]
operations = [
migrations.RemoveField(
model_name='recruiter',
name='middl... | en | 0.80045 | # Generated by Django 3.1.7 on 2021-03-05 10:21 | 1.523546 | 2 |
src/promnesia/sources/telegram.py | halhenke/promnesia | 1,327 | 4877 | <reponame>halhenke/promnesia<filename>src/promnesia/sources/telegram.py
'''
Uses [[https://github.com/fabianonline/telegram_backup#readme][telegram_backup]] database for messages data
'''
from pathlib import Path
from textwrap import dedent
from typing import Optional, Union, TypeVar
from urllib.parse import unquote #... | '''
Uses [[https://github.com/fabianonline/telegram_backup#readme][telegram_backup]] database for messages data
'''
from pathlib import Path
from textwrap import dedent
from typing import Optional, Union, TypeVar
from urllib.parse import unquote # TODO mm, make it easier to rememember to use...
from ..common import P... | en | 0.668157 | Uses [[https://github.com/fabianonline/telegram_backup#readme][telegram_backup]] database for messages data # TODO mm, make it easier to rememember to use... # TODO potentially, belongs to my. package # TODO kython? # TODO move to common? # type: ignore # see https://github.com/pudo/dataset/issues/136#issuecomment-1286... | 2.332434 | 2 |
shellmacros/istr.py | duaneellissd/shellmacros | 0 | 4878 | '''
Created on Dec 27, 2019
@author: duane
'''
DOLLAR = ord('$')
LBRACE = ord('{')
RBRACE = ord('}')
LPAREN = ord('(')
RPAREN = ord(')')
class IStrFindResult(object):
OK = 0
NOTFOUND = 1
SYNTAX = 2
def __init__(self):
self.result = IStrFindResult.SYNTAX
self.lhs = 0
self.rh... | '''
Created on Dec 27, 2019
@author: duane
'''
DOLLAR = ord('$')
LBRACE = ord('{')
RBRACE = ord('}')
LPAREN = ord('(')
RPAREN = ord(')')
class IStrFindResult(object):
OK = 0
NOTFOUND = 1
SYNTAX = 2
def __init__(self):
self.result = IStrFindResult.SYNTAX
self.lhs = 0
self.rh... | en | 0.864245 | Created on Dec 27, 2019 @author: duane This closely models a basic ASCII string Note: Unicode strings are expressly not supported here. The problem this addresses occurs during macro processing. Sometimes macros are defined externally Other times, macros are fully defined with a package. Often m... | 2.833416 | 3 |
cli.py | checktheroads/deenis | 4 | 4879 | <filename>cli.py
#!/usr/bin/env python3
"""
CLI for Accessing Deenis
"""
# Standard Imports
import sys
from pathlib import Path
# Module Imports
import click
# Path Fixes
working_dir = Path(__file__).resolve().parent
sys.path.append(str(working_dir))
# Project Imports
from deenis import Deenis
@click.group(
hel... | <filename>cli.py
#!/usr/bin/env python3
"""
CLI for Accessing Deenis
"""
# Standard Imports
import sys
from pathlib import Path
# Module Imports
import click
# Path Fixes
working_dir = Path(__file__).resolve().parent
sys.path.append(str(working_dir))
# Project Imports
from deenis import Deenis
@click.group(
hel... | en | 0.551944 | #!/usr/bin/env python3 CLI for Accessing Deenis # Standard Imports # Module Imports # Path Fixes # Project Imports Click Command Group Definition # pylint: disable=unnecessary-pass # Dear Pylint: This is how Click likes to do things. Get over it bruh. Add host records from CLI Add Tenant Records from CLI Response forma... | 2.912454 | 3 |
main_cl.py | spiolynn/pybo | 0 | 4880 | # coding: utf-8
from bigone import BigOneDog
from common import gen_logger
import logging
import time
import json
def strategy_eth_big_bnc_eth(dog):
"""
正向:买BIG/ETH -> 卖BIG/BNC -> 买ETH/BNC
反向:卖ETH/BNC -> 买BIG/BNC -> 卖BIG/ETH
:param dog: implemention of BigOneDog
:return: 正向收益率,反向收益率
"""
... | # coding: utf-8
from bigone import BigOneDog
from common import gen_logger
import logging
import time
import json
def strategy_eth_big_bnc_eth(dog):
"""
正向:买BIG/ETH -> 卖BIG/BNC -> 买ETH/BNC
反向:卖ETH/BNC -> 买BIG/BNC -> 卖BIG/ETH
:param dog: implemention of BigOneDog
:return: 正向收益率,反向收益率
"""
... | en | 0.305543 | # coding: utf-8 正向:买BIG/ETH -> 卖BIG/BNC -> 买ETH/BNC 反向:卖ETH/BNC -> 买BIG/BNC -> 卖BIG/ETH :param dog: implemention of BigOneDog :return: 正向收益率,反向收益率 # positive transaction # negative transaction # dog.create_order('BIG-ETH','ASK', big_eth_data['asks'][0]['price'], '2.0') # dog.create_order('BIG-BNC','BID', bi... | 2.306327 | 2 |
run_experiments.py | gahaalt/cifar-vs-tensorflow2 | 6 | 4881 | import os
import yaml
import logging
import importlib
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
logging.getLogger('tensorflow').disabled = True
from cifar_training_tools import cifar_training, cifar_error_test
def print_dict(d, tabs=0):
tab = '\t'
for key in d:
if type(d[key]) == dict:
pri... | import os
import yaml
import logging
import importlib
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
logging.getLogger('tensorflow').disabled = True
from cifar_training_tools import cifar_training, cifar_error_test
def print_dict(d, tabs=0):
tab = '\t'
for key in d:
if type(d[key]) == dict:
pri... | none | 1 | 2.351239 | 2 | |
json2yaml.py | cristicalin/tools | 0 | 4882 | <filename>json2yaml.py<gh_stars>0
#!/usr/bin/python
import sys
import yaml
import json
if __name__ == '__main__':
content = json.load(sys.stdin)
print yaml.dump(content, indent=2, default_flow_style=False)
| <filename>json2yaml.py<gh_stars>0
#!/usr/bin/python
import sys
import yaml
import json
if __name__ == '__main__':
content = json.load(sys.stdin)
print yaml.dump(content, indent=2, default_flow_style=False)
| ru | 0.258958 | #!/usr/bin/python | 2.061996 | 2 |
histdata/mt5db/script_DownloadAndStoreToMongodb.py | UpSea/midProjects | 1 | 4883 | # -*- coding: utf-8 -*-
import os,sys
from PyQt4 import QtGui,QtCore
dataRoot = os.path.abspath(os.path.join(os.path.dirname(__file__),os.pardir,os.pardir,'histdata'))
sys.path.append(dataRoot)
import dataCenter as dataCenter
from data.mongodb.DataSourceMongodb import Mongodb
import datetime as dt
... | # -*- coding: utf-8 -*-
import os,sys
from PyQt4 import QtGui,QtCore
dataRoot = os.path.abspath(os.path.join(os.path.dirname(__file__),os.pardir,os.pardir,'histdata'))
sys.path.append(dataRoot)
import dataCenter as dataCenter
from data.mongodb.DataSourceMongodb import Mongodb
import datetime as dt
... | en | 0.171614 | # -*- coding: utf-8 -*- #mid 1)从excel赋值粘贴获得如下数据 XAGUSD #mid 2)将字符串使用split()分割为list,默认会去除\n和所有空格。 #codeList = ['000021.SZ','000022.SZ'] # 1)get codes form eastmoney # 2)download history data #app = QtGui.QApplication(sys.argv) #mid------------------------------------------------------------------------------------------... | 2.112505 | 2 |
daproli/transformer.py | ermshaua/daproli | 0 | 4884 | <filename>daproli/transformer.py
from joblib import Parallel, delayed
from tqdm import tqdm
from .processing import map, filter, split, expand, combine, join
from .manipulation import windowed, flatten
class BaseTransformer:
'''
The BaseTransformer defines a generic data transformation pattern that
can b... | <filename>daproli/transformer.py
from joblib import Parallel, delayed
from tqdm import tqdm
from .processing import map, filter, split, expand, combine, join
from .manipulation import windowed, flatten
class BaseTransformer:
'''
The BaseTransformer defines a generic data transformation pattern that
can b... | en | 0.435747 | The BaseTransformer defines a generic data transformation pattern that can be implemented with a number of data processing concepts. dp.Mapper is the respective transformer for dp.map. Parameters ----------- :param func: the mapping function :param ret_type: if provided the used ret... | 2.579126 | 3 |
Ad-Hoc/2454.py | LorranSutter/URI-Online-Judge | 0 | 4885 | <gh_stars>0
P, R = input().split()
if P == '0': print('C')
elif R == '0': print('B')
else: print('A') | P, R = input().split()
if P == '0': print('C')
elif R == '0': print('B')
else: print('A') | none | 1 | 3.643127 | 4 | |
main.py | brunotoshio/castella | 2 | 4886 | <filename>main.py
import pymongo
import yaml
import sched
import time
import json
from castella import TweetCrawler
class Castella(object):
def __init__(self):
# Get connection parameters
with open("settings.yml", "r") as stream:
try:
settings = yaml.safe_load(stream)["... | <filename>main.py
import pymongo
import yaml
import sched
import time
import json
from castella import TweetCrawler
class Castella(object):
def __init__(self):
# Get connection parameters
with open("settings.yml", "r") as stream:
try:
settings = yaml.safe_load(stream)["... | en | 0.578134 | # Get connection parameters # Database # Search # Schedule # Mongo connection # Continue from last id # Searching # Preparing functions for scheduler # Scheduling events | 2.492147 | 2 |
ngraph/test/frontend/paddlepaddle/test_models/gen_scripts/generate_slice.py | monroid/openvino | 2,406 | 4887 | <reponame>monroid/openvino
#
# slice paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle as pdpd
import sys
data_type = 'float32'
def slice(name : str, x, axes : list, start : list, end : list):
pdpd.enable_static()
with pdpd.static.program_guard(pdpd.static.Program(), ... | #
# slice paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle as pdpd
import sys
data_type = 'float32'
def slice(name : str, x, axes : list, start : list, end : list):
pdpd.enable_static()
with pdpd.static.program_guard(pdpd.static.Program(), pdpd.static.Program()):
... | en | 0.511466 | # # slice paddle model generator # # startup program will call initializer to initialize the parameters. | 2.584472 | 3 |
tacker/sol_refactored/common/vnf_instance_utils.py | h1r0mu/tacker | 116 | 4888 | # Copyright (C) 2021 Nippon Telegraph and Telephone Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | # Copyright (C) 2021 Nippon Telegraph and Telephone Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | en | 0.831692 | # Copyright (C) 2021 Nippon Telegraph and Telephone Corporation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICE... | 1.830455 | 2 |
testfixtures/compat.py | cjw296/testfixtures | 0 | 4889 | # compatibility module for different python versions
import sys
if sys.version_info[:2] > (3, 0):
PY2 = False
PY3 = True
Bytes = bytes
Unicode = str
basestring = str
class_type_name = 'class'
ClassType = type
exception_module = 'builtins'
new_class = type
self_name = '__self_... | # compatibility module for different python versions
import sys
if sys.version_info[:2] > (3, 0):
PY2 = False
PY3 = True
Bytes = bytes
Unicode = str
basestring = str
class_type_name = 'class'
ClassType = type
exception_module = 'builtins'
new_class = type
self_name = '__self_... | en | 0.473796 | # compatibility module for different python versions | 2.386674 | 2 |
old_py2/tests/models_tests/notifications/test_match_score.py | ofekashery/the-blue-alliance | 266 | 4890 | <reponame>ofekashery/the-blue-alliance<filename>old_py2/tests/models_tests/notifications/test_match_score.py<gh_stars>100-1000
import re
import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.notification_type import NotificationType
from helpers.event.event_test_cr... | import re
import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from consts.notification_type import NotificationType
from helpers.event.event_test_creator import EventTestCreator
from models.team import Team
from models.notifications.match_score import MatchScoreNotification... | en | 0.855948 | # Prevent data from leaking between tests # Has `event_name` | 2.417676 | 2 |
util/submission/templates.py | jeanlucf22/mgmol | 25 | 4891 | md_template_d144 = """verbosity=0
xcFunctional=PBE
FDtype=4th
[Mesh]
nx=160
ny=80
nz=80
[Domain]
ox=0.
oy=0.
oz=0.
lx=42.4813
ly=21.2406
lz=21.2406
[Potentials]
pseudopotential=pseudo.D_tm_pbe
[Poisson]
solver=@
max_steps_initial=@50
max_steps=@50
reset=@
bcx=periodic
bcy=periodic
bcz=periodic
[Run]
type=MD
[MD]
type=@... | md_template_d144 = """verbosity=0
xcFunctional=PBE
FDtype=4th
[Mesh]
nx=160
ny=80
nz=80
[Domain]
ox=0.
oy=0.
oz=0.
lx=42.4813
ly=21.2406
lz=21.2406
[Potentials]
pseudopotential=pseudo.D_tm_pbe
[Poisson]
solver=@
max_steps_initial=@50
max_steps=@50
reset=@
bcx=periodic
bcy=periodic
bcz=periodic
[Run]
type=MD
[MD]
type=@... | en | 0.336342 | verbosity=0 xcFunctional=PBE FDtype=4th [Mesh] nx=160 ny=80 nz=80 [Domain] ox=0. oy=0. oz=0. lx=42.4813 ly=21.2406 lz=21.2406 [Potentials] pseudopotential=pseudo.D_tm_pbe [Poisson] solver=@ max_steps_initial=@50 max_steps=@50 reset=@ bcx=periodic bcy=periodic bcz=periodic [Run] type=MD [MD] type=@ num_steps=@ dt=@15. [... | 1.076293 | 1 |
Compliant_control/Force Tracking/archive/VIC_Huang1992_(main 09.03).py | martihmy/Compliant_control | 0 | 4892 | #! /usr/bin/env python
import copy
from copy import deepcopy
import rospy
import threading
import quaternion
import numpy as np
from geometry_msgs.msg import Point
from visualization_msgs.msg import *
from franka_interface import ArmInterface
from panda_robot import PandaArm
import matplotlib.pyplot as plt
from scipy.s... | #! /usr/bin/env python
import copy
from copy import deepcopy
import rospy
import threading
import quaternion
import numpy as np
from geometry_msgs.msg import Point
from visualization_msgs.msg import *
from franka_interface import ArmInterface
from panda_robot import PandaArm
import matplotlib.pyplot as plt
from scipy.s... | en | 0.613101 | #! /usr/bin/env python This is a FORCE-BASED VARIABLE IMPEDANCE CONTROLLER based on [Huang1992: Compliant Motion Control of Robots by Using Variable Impedance] To achieve force tracking, the apparent stiffness (K) and damping (B) is dynamically adjusted through functions dependent on the error in position, velocity an... | 2.614511 | 3 |
tests/migrations/0010_modeltest_datetime_field1.py | intellineers/django-bridger | 2 | 4893 | # Generated by Django 2.2.9 on 2020-01-28 14:50
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("tests", "0009_auto_20200113_1239"),
]
operations = [
migrations.AddField(
model_name="modeltest",
... | # Generated by Django 2.2.9 on 2020-01-28 14:50
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("tests", "0009_auto_20200113_1239"),
]
operations = [
migrations.AddField(
model_name="modeltest",
... | en | 0.843095 | # Generated by Django 2.2.9 on 2020-01-28 14:50 | 1.747653 | 2 |
pycmap/common.py | mdashkezari/pycmap | 4 | 4894 | <reponame>mdashkezari/pycmap
"""
Author: <NAME> <<EMAIL>>
Date: 2019-06-28
Function: Host a collection of shared multi-purpose helper functions.
"""
import os
import sys
from tqdm import tqdm
from colorama import Fore, Back, Style, init
import numpy as np
import pandas as pd
import webbrowser
import I... | """
Author: <NAME> <<EMAIL>>
Date: 2019-06-28
Function: Host a collection of shared multi-purpose helper functions.
"""
import os
import sys
from tqdm import tqdm
from colorama import Fore, Back, Style, init
import numpy as np
import pandas as pd
import webbrowser
import IPython
MAX_ROWS = 2000000
... | en | 0.69476 | Author: <NAME> <<EMAIL>>
Date: 2019-06-28
Function: Host a collection of shared multi-purpose helper functions. Prints an error message and terminates the program. Print helper function compatible with tqdmm progressbar. # init() Returns API root endpoint. Returns True if jupyter notebook has invoked the package.... | 2.464073 | 2 |
tests/test_device.py | michaelwoods/home-assistant-cli | 0 | 4895 | """Testing Device operations."""
import json
import unittest.mock as mock
from click.testing import CliRunner
import homeassistant_cli.cli as cli
def test_device_list(default_devices) -> None:
"""Test Device List."""
with mock.patch(
'homeassistant_cli.remote.get_devices', return_value=default_devic... | """Testing Device operations."""
import json
import unittest.mock as mock
from click.testing import CliRunner
import homeassistant_cli.cli as cli
def test_device_list(default_devices) -> None:
"""Test Device List."""
with mock.patch(
'homeassistant_cli.remote.get_devices', return_value=default_devic... | en | 0.816887 | Testing Device operations. Test Device List. Test Device List. Test basic device assign. | 2.790701 | 3 |
widgets/tree_item.py | tarsa129/j3d-animation-editor | 6 | 4896 | <filename>widgets/tree_item.py<gh_stars>1-10
from PyQt5.QtWidgets import QAction, QTreeWidget, QTreeWidgetItem, QFileDialog
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt
import animations.general_animation as j3d
from widgets.yaz0 import compress, compress_slow, compress_fast
from io import BytesIO
class ... | <filename>widgets/tree_item.py<gh_stars>1-10
from PyQt5.QtWidgets import QAction, QTreeWidget, QTreeWidgetItem, QFileDialog
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import Qt
import animations.general_animation as j3d
from widgets.yaz0 import compress, compress_slow, compress_fast
from io import BytesIO
class ... | en | 0.890471 | #this is a pure bck, no saving #this is a pure bck, no saving | 2.519213 | 3 |
Wheels.py | edhosken/WheelsSong | 0 | 4897 | <gh_stars>0
#Create the pre-defined song values and empty variables...Correct names not used so each starting letter would be unique
numbers = (1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18 )
letters = ['a ','b ','c ','d ','e ','f ','g ','h ','i ','j ','k ','l ','m ','n ','o ','p ','q ','r ']
roman =... | #Create the pre-defined song values and empty variables...Correct names not used so each starting letter would be unique
numbers = (1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18 )
letters = ['a ','b ','c ','d ','e ','f ','g ','h ','i ','j ','k ','l ','m ','n ','o ','p ','q ','r ']
roman = ['I ', 'II ... | en | 0.666216 | #Create the pre-defined song values and empty variables...Correct names not used so each starting letter would be unique ##Build morse code sequences ##Other ideas: piglatin, japanese, spanish, prime, tau, e, ... ##NEED TO ADD INVALID ENTRY CATCHES ##Seeming silly switching of strings to list types #User input to selec... | 2.928705 | 3 |
tests/test_config.py | dfroger/conda | 0 | 4898 | # (c) 2012-2014 Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
import os
from os.path import dirname, join, exists
import unittest
import pytest
import con... | # (c) 2012-2014 Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
import os
from os.path import dirname, join, exists
import unittest
import pytest
import con... | en | 0.461312 | # (c) 2012-2014 Continuum Analytics, Inc. / http://continuum.io # All Rights Reserved # # conda is distributed under the terms of the BSD 3-clause license. # Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause. # use condarc from source tree to run these tests against # unset CIO_TEST. This is a Continu... | 1.879314 | 2 |
malaya/transformers/babble.py | ahmed3991/malaya | 1 | 4899 | <filename>malaya/transformers/babble.py
# Bert has a Mouth, and It Must Speak: BERT as a Markov Random Field Language Model,
# by <NAME>, <NAME>, NeuralGen 2019
# https://colab.research.google.com/drive/1MxKZGtQ9SSBjTK5ArsZ5LKhkztzg52RV
# https://arxiv.org/abs/1902.04094
import tensorflow as tf
import tensorflow_proba... | <filename>malaya/transformers/babble.py
# Bert has a Mouth, and It Must Speak: BERT as a Markov Random Field Language Model,
# by <NAME>, <NAME>, NeuralGen 2019
# https://colab.research.google.com/drive/1MxKZGtQ9SSBjTK5ArsZ5LKhkztzg52RV
# https://arxiv.org/abs/1902.04094
import tensorflow as tf
import tensorflow_proba... | en | 0.754644 | # Bert has a Mouth, and It Must Speak: BERT as a Markov Random Field Language Model, # by <NAME>, <NAME>, NeuralGen 2019 # https://colab.research.google.com/drive/1MxKZGtQ9SSBjTK5ArsZ5LKhkztzg52RV # https://arxiv.org/abs/1902.04094 | 2.459504 | 2 |